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. 'QtGui/QMainWindow' file not found

'QtGui/QMainWindow' file not found

Scheduled Pinned Locked Moved Installation and Deployment
10 Posts 4 Posters 22.5k Views
  • 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.
  • B Offline
    B Offline
    boehsermoe
    wrote on last edited by
    #1

    Hi,
    I can't build my project, with the Error 'QtGui/QMainWindow' file not found at the line:

    @#include <QtGui/QMainWindow>@

    The autocomplete doesnt show the 'QtGui' or something, only 'QtUiTools'.
    I looked in the Libraries/Frameworks (OS X) but there are no Qt files.

    Thank for help

    1 Reply Last reply
    0
    • W Offline
      W Offline
      walur
      wrote on last edited by
      #2

      use in projectfile:

      QT += core gui
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      ...

      using Qt 5.x, write only:
      ...
      #include <QMainWindow>
      ...

      that should work
      greetings walur

      1 Reply Last reply
      0
      • B Offline
        B Offline
        boehsermoe
        wrote on last edited by
        #3

        I already tried it...

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

          Hi and welcome to devnet,

          What version of Qt are you using on what version of OS X ?

          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
          • B Offline
            B Offline
            boehsermoe
            wrote on last edited by
            #5

            Qt 5.1.1 and OS X 10.9

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

              The I would recommend to change directly to 5.2, it has better support for 10.9.

              Also, did you change the #include <QtGui/QMainWindow> line ? In Qt 5 it's in the QtWidgets module

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

              S 1 Reply Last reply
              0
              • SGaistS SGaist

                The I would recommend to change directly to 5.2, it has better support for 10.9.

                Also, did you change the #include <QtGui/QMainWindow> line ? In Qt 5 it's in the QtWidgets module

                S Offline
                S Offline
                Sravanthi
                wrote on last edited by
                #7

                @SGaist I am compiling qt 4.8.6 windows code over linux with GDB, I am too facing 'QMainWindow' not found.

                I am using the below lines,
                QT += core gui
                greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

                Thanks
                Sravanthi

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

                  Do you have #include <QMainWindow> only ? Or do you have the module before ? If the second, just remove the module from the include line.

                  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
                  • S Offline
                    S Offline
                    Sravanthi
                    wrote on last edited by
                    #9

                    @SGaist #include <QMainWindow> is palced on top.

                    The following link is asking to edit the cmake file, where can i find the cmake file ?

                    http://stackoverflow.com/questions/19328933/simple-qtproject-with-cmake-qmainwindow-no-such-file-or-directory

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

                      You are using a .pro file so it doesn't apply.

                      How did you install Qt ?

                      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