How do I create a simple Qt console application in C++?

前端 未结 7 1080
别那么骄傲
别那么骄傲 2020-11-28 22:06

I was trying to create a simple console application to try out Qt\'s XML parser. I started a project in VS2008 and got this template:

int main(int argc, char         


        
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 22:49

    You don't need the QCoreApplication at all, just include your Qt objects as you would other objects, for example:

    #include 
    
    int main()
    {
        QVector a; // Qt object
    
        for (int i=0; i<10; i++)
        {
            a.append(i);
        }
    
        /* manipulate a here */
    
        return 0;
    }
    

提交回复
热议问题