Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Simple examples
Qt 6.11 is out! See what's new in the release blog

Simple examples

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DaveAllerton
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      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.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved