Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Missing File or Directory?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Missing File or Directory?

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 2.0k 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.
  • O Offline
    O Offline
    overtime
    wrote on last edited by
    #1

    @C:\Users\Darrel\Desktop\smartphonebrainscanner2-Brain3D\main.cpp:1: error: QtGui/QApplication: No such file or directory
    #include <QtGui/QApplication>
    ^@

    Why would this be missing...

    1 Reply Last reply
    0
    • S Offline
      S Offline
      stevenceuppens
      wrote on last edited by
      #2

      Hi,

      There are 3 application types in Qt5

      QCoreApplication -> Command-Line App -> (needs module “core”)
      QGuiApplication -> Quick App -> (needs module “gui”)
      QApplication -> Widget App -> (needs module “widget”)

      You are using quick, so you may change QApplication to
      @
      #include <QtGui/QGuiApplication>

      int main(int argc, char *argv[])
      {
      QGuiApplication app(argc, argv);

      ...
      
      return app.exec();
      

      }
      @

      Steven CEUPPENS
      Developer &#x2F; Architect
      Mobile: +32 479 65 93 10

      1 Reply Last reply
      0
      • O Offline
        O Offline
        overtime
        wrote on last edited by
        #3

        I feel like I've been dancing around this issue for awhile :-/
        4.8 -> 5.2

        Problem is that even when I use Qt 4.8 I run into more problems. I'll keep at it. Thanks for bearing with me!

        I'll have these memorized by the end of this project!

        1 Reply Last reply
        0
        • O Offline
          O Offline
          overtime
          wrote on last edited by
          #4

          Wait a second so what do I do with this?

          @QScopedPointer<QApplication> app(createApplication(argc, argv));

          ...

          return app->exec();@

          to this?

          @
          QScopedPointer<QGuiApplication> app(createApplication(argc, argv));

          ...

          return app.exec();@

          1 Reply Last reply
          0
          • S Offline
            S Offline
            stevenceuppens
            wrote on last edited by
            #5

            indeed,

            @
            #include <QtGui/QGuiApplication>

            int main(int argc, char *argv[])
            {
            QScopedPointer<QGuiApplication> app(createApplication(argc, argv));

            ...
            
            return app.exec();
            

            }
            @

            This would do the trick!

            But: ... I rater like to use it this way:

            @
            #include <QtGui/QGuiApplication>

            int main(int argc, char *argv[])
            {
            QGuiApplication app(argc, argv);

            ...
            
            return app.exec();
            

            }
            @

            As creating your app on the heap doesn't make much sense...

            when the app exits, app goes out of scope and gets deleted anyway, and stack mem is faster..

            unless there is a special reason to do it your way..!

            Both examples are valid.

            Steven CEUPPENS
            Developer &#x2F; Architect
            Mobile: +32 479 65 93 10

            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