Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. What Environmental Variables PATH I need to add for Qt5 to recognize include <QtGui/QApplication> [Solved]
Forum Updated to NodeBB v4.3 + New Features

What Environmental Variables PATH I need to add for Qt5 to recognize include <QtGui/QApplication> [Solved]

Scheduled Pinned Locked Moved Installation and Deployment
10 Posts 2 Posters 6.7k 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.
  • G Offline
    G Offline
    GoldenAxe
    wrote on last edited by
    #1

    What Environmental Variables PATH I need to add for Qt5 to recognize include <QtGui/QApplication> ?
    I already added "C:\qt5\2012.11\qtbase\bin and C:\qt5\2012.11\qtbase\lib"

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Includes are not handled by PATH. There is no <QtGui/QApplication> in Qt5. It's either <QtWidgets/QApplication> or <QtGui/QGuiApplication>, depending on what you need.

      (Z(:^

      1 Reply Last reply
      0
      • G Offline
        G Offline
        GoldenAxe
        wrote on last edited by
        #3

        It's sounds odd to me, they changed the includes! meaning Qt5 not supported by older projects without changing all the includes? Now I need to manually change all my projects includes?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          "All" is a bit of an exaggeration here... it's just QApplication and a few others (Qt has over 1000 classes... most of them were not changed). You can always stop using module names in front of the includes - this way source compatibility is preserved (so, you can use just <QApplication>).

          I have ported a few projects to Qt5 and I have to tell you - this is really not a problem. First, you do it once only, second - you can use automated tools provided in Qt5 to do it with a single click, third - there aren't really that many differences.

          Going back to QApplication - the reason behind those changes is that the Gui module was split. Now the stack is: QtCore, QtGui + either QtWidgets or QtQuick. Some general classes were left in QtGui, while all the widget-specific ones were moved to QtWidgets.

          (Z(:^

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GoldenAxe
            wrote on last edited by
            #5

            The problem I have some shared projects with a friend and he is using Qt 4.8.x.
            We using Dropbox and we are working on the same projects at the same time (which works pretty well, with the file refreshment dialog), now if I work with Qt5 we can't do it, as the file includes will be different...

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              You can, just use a few macros.

              Example:
              @
              #if QT_VERSION_MAJOR >= 0x050000
              #include <QtGui/QGuiApplication>
              #else
              #include <QtGui/QApplication>
              #endif
              @

              Or, as hinted before, just go with:
              @
              #include <QApplication>
              @

              You can take a look at Qt Creator sources, they are using this very same trick.

              (Z(:^

              1 Reply Last reply
              0
              • G Offline
                G Offline
                GoldenAxe
                wrote on last edited by
                #7

                Ok I'll give it a try, thanks!
                By the way there is any diffrences between those two git packs: http://qt.gitorious.org/qt/qt5 and http://qt.gitorious.org/qtsdk, as they both seems to be Qt5 projects?

                1 Reply Last reply
                0
                • sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by
                  #8

                  I don't know. I use the qt5 one to checkout and compile qt5 sources. SDK probably also provides the installer.

                  Actual code is stored in module branches anyway (qt/qtbase, qt/qtxml etc.).

                  (Z(:^

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    GoldenAxe
                    wrote on last edited by
                    #9

                    OK thanks, final question what configure did you use?

                    1 Reply Last reply
                    0
                    • sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #10

                      I usually follow "the instructions on the wiki":http://qt-project.org/wiki/Building_Qt_5_from_Git. But you can also download the Qt5 Beta 2 SDK, it was released yesterday.

                      (Z(:^

                      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