Simple examples



  • I've installed Qt 5.1.1 in Windows 7 (mingw 4.8 + openGL). However, I can't get the simple 'hello word' (from version 4) to compile and run. Is there are simple guide to running simple programs, so that I can get started? I've looked through all the installation and tutorial documentation, which mostly tells me about things I don't need to know. I only want to develop a simple GUI - it should be easy with Qt but it seems far from clear.


  • Moderators

    welcome to devnet

    There is a subtle difference in the .pro file. For version 5 you need to add
    @
    QT += widgets
    @

    Respectively in order to remain compatible with Qt4 you can add in the .pro file:
    @
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    @

    Other than that you need to post the error return you receive.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Since you took a Qt 4 widget example you are probably missing
    @QT += widgets@

    In your pro file. You can start using a new widget project from Qt Creator and it will be setup for you.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.