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. Qt Creator not importing proper GUI files automatically
Forum Updated to NodeBB v4.3 + New Features

Qt Creator not importing proper GUI files automatically

Scheduled Pinned Locked Moved Solved General and Desktop
6 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.
  • P Offline
    P Offline
    PhantomR
    wrote on last edited by PhantomR
    #1

    Hello,

    I'm using Qt Creator Qt Creator 4.2.1 with Qt 5.8 x64 (installed using an installer) on Ubuntu 16.10 x64. It seems that when I create a new Dialog (with Add New -> Qt Designer Form Class), it does not import the right file (in the header it imports, "QtGui/QDialog" automatically), so it's strange. The same happens on new project creation with QMainWindow. It seems like removing the "QtGui/" is a valid fix, but why does this happen in the first place? . The .pro does contain the "greaterThan(QT_MAJOR_VERSION, 4): QT += widgets.

    Apprently, this problem does not happen on Windows, but as far as I remember, it didn't use to happen on Ubuntu either, when I first installed Qt. Not sure what happened though. I also tried uninstalling Qt / reinstalling and also using the Qt Creator 4.3 Beta, but the same problem happens.

    jsulmJ 1 Reply Last reply
    0
    • P Offline
      P Offline
      PhantomR
      wrote on last edited by PhantomR
      #6

      Update: After reinstalling Ubuntu 17.04 and installing Qt 5.8 x64, the includes no longer seem to be broken.

      Edit: Thank you all for your replies.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mostefa
        wrote on last edited by
        #2

        Hi @PhantomR

        I am working under ubuntu 14.04 , and Qt 5.8 (installed using an installer too) and i am not having this problem ,

        the inclulde is :

        #include <QDialog>
        

        alt text

        1 Reply Last reply
        2
        • P Offline
          P Offline
          PhantomR
          wrote on last edited by
          #3

          Thank you for your answer @mostefa . I wonder what happened.. I do remember it worked when I first installed Qt. Is there some way to uninstall Qt so that all settings are erased and I can do a fresh install afterwards?

          1 Reply Last reply
          0
          • P PhantomR

            Hello,

            I'm using Qt Creator Qt Creator 4.2.1 with Qt 5.8 x64 (installed using an installer) on Ubuntu 16.10 x64. It seems that when I create a new Dialog (with Add New -> Qt Designer Form Class), it does not import the right file (in the header it imports, "QtGui/QDialog" automatically), so it's strange. The same happens on new project creation with QMainWindow. It seems like removing the "QtGui/" is a valid fix, but why does this happen in the first place? . The .pro does contain the "greaterThan(QT_MAJOR_VERSION, 4): QT += widgets.

            Apprently, this problem does not happen on Windows, but as far as I remember, it didn't use to happen on Ubuntu either, when I first installed Qt. Not sure what happened though. I also tried uninstalling Qt / reinstalling and also using the Qt Creator 4.3 Beta, but the same problem happens.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @PhantomR Do you have Qt 4.8 installed and configured in QtCreator?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • P Offline
              P Offline
              PhantomR
              wrote on last edited by
              #5

              @jsulm Thank you for your answer. No, I did not install Qt 4.8. Only 5.8 x64 shows up in Qt Creator right now, but previously I've also installed 5.9 beta (right now, only 5.8 is installed since I removed them both and didn't install 5.9 again). I'll try to reinstall Ubuntu today (I've kind of messed it up a while ago anyway), hopefully it'll solve the problem.

              1 Reply Last reply
              0
              • P Offline
                P Offline
                PhantomR
                wrote on last edited by PhantomR
                #6

                Update: After reinstalling Ubuntu 17.04 and installing Qt 5.8 x64, the includes no longer seem to be broken.

                Edit: Thank you all for your replies.

                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