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. QGuiApplication: No such file or directory
QtWS25 Last Chance

QGuiApplication: No such file or directory

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 3 Posters 8.1k 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.
  • embdevE Offline
    embdevE Offline
    embdev
    wrote on last edited by
    #1

    Dear fellow coders, i'm trying to use my own kit to build an exe file using the example 'clocks' in Qt examples but was unsuccessful.

    Under [Issues] window says: 'QGuiApplication: no such file or directory'

    Is there anything wrong with my Kit's qmake.exe file? When I use the default GCC desktop kit, the program compiles and run successfully.

    1 Reply Last reply
    0
    • KambizK Offline
      KambizK Offline
      Kambiz
      wrote on last edited by Kambiz
      #2

      Which version of Qt ?!

      Check your .pro file you need to add QT += widgets in the .pro file after that run qmake once and use #include <QApplication> instead of #include <QtGui/QApplication>

      .:.We speak a universal language that brings us together.:.

      1 Reply Last reply
      0
      • embdevE Offline
        embdevE Offline
        embdev
        wrote on last edited by
        #3

        let me check my Qt installation again.

        jsulmJ 1 Reply Last reply
        0
        • embdevE embdev

          let me check my Qt installation again.

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

          @embdev Why not do what @Kambiz suggested first?

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

          1 Reply Last reply
          0
          • embdevE Offline
            embdevE Offline
            embdev
            wrote on last edited by
            #5

            ah I missed that line, my network previously having some issues. let me try out @Kambiz suggestion first

            1 Reply Last reply
            0
            • embdevE Offline
              embdevE Offline
              embdev
              wrote on last edited by p3c0
              #6

              Hi @Kambiz mbiz & @jsulm , aft added QT += widgets and using <QApplication>, the next error is "QQmlengine: No such file or directory" The following is a sample code from Clocks example, built on Qt Quick.

              #include <QDir>
              //#include <QGuiApplication>
              #include <QApplication>
              #include <QQmlEngine>
              #include <QQmlFileSelector>
              #include <QQuickView> //Not using QQmlApplicationEngine because many examples don't have a Window{}
              #define DECLARATIVE_EXAMPLE_MAIN(NAME) int main(int argc, char* argv[]) \
              {\
                  QGuiApplication app(argc,argv);\
                  app.setOrganizationName("QtProject");\
                  app.setOrganizationDomain("qt-project.org");\
                  app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());\
                  QQuickView view;\
                  if (qgetenv("QT_QUICK_CORE_PROFILE").toInt()) {\
                      QSurfaceFormat f = view.format();\
                      f.setProfile(QSurfaceFormat::CoreProfile);\
                      f.setVersion(4, 4);\
                      view.setFormat(f);\
                  }\
                  view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\
                  new QQmlFileSelector(view.engine(), &view);\
                  view.setSource(QUrl("qrc:///" #NAME ".qml")); \
                  view.setResizeMode(QQuickView::SizeRootObjectToView);\
                  if (QGuiApplication::platformName() == QLatin1String("qnx") || \
                        QGuiApplication::platformName() == QLatin1String("eglfs")) {\
                      view.showFullScreen();\
                  } else {\
                      view.show();\
                  }\
                  return app.exec();\
              }
              
              jsulmJ 1 Reply Last reply
              0
              • embdevE embdev

                Hi @Kambiz mbiz & @jsulm , aft added QT += widgets and using <QApplication>, the next error is "QQmlengine: No such file or directory" The following is a sample code from Clocks example, built on Qt Quick.

                #include <QDir>
                //#include <QGuiApplication>
                #include <QApplication>
                #include <QQmlEngine>
                #include <QQmlFileSelector>
                #include <QQuickView> //Not using QQmlApplicationEngine because many examples don't have a Window{}
                #define DECLARATIVE_EXAMPLE_MAIN(NAME) int main(int argc, char* argv[]) \
                {\
                    QGuiApplication app(argc,argv);\
                    app.setOrganizationName("QtProject");\
                    app.setOrganizationDomain("qt-project.org");\
                    app.setApplicationName(QFileInfo(app.applicationFilePath()).baseName());\
                    QQuickView view;\
                    if (qgetenv("QT_QUICK_CORE_PROFILE").toInt()) {\
                        QSurfaceFormat f = view.format();\
                        f.setProfile(QSurfaceFormat::CoreProfile);\
                        f.setVersion(4, 4);\
                        view.setFormat(f);\
                    }\
                    view.connect(view.engine(), SIGNAL(quit()), &app, SLOT(quit()));\
                    new QQmlFileSelector(view.engine(), &view);\
                    view.setSource(QUrl("qrc:///" #NAME ".qml")); \
                    view.setResizeMode(QQuickView::SizeRootObjectToView);\
                    if (QGuiApplication::platformName() == QLatin1String("qnx") || \
                          QGuiApplication::platformName() == QLatin1String("eglfs")) {\
                        view.showFullScreen();\
                    } else {\
                        view.show();\
                    }\
                    return app.exec();\
                }
                
                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @embdev said in QGuiApplication: No such file or directory:

                QQmlEngine

                Well, if you check the Qt documentation for QQmlEngine you will find out what you need to do :
                QT += qml
                http://doc.qt.io/qt-5/qqmlengine.html

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

                embdevE 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @embdev said in QGuiApplication: No such file or directory:

                  QQmlEngine

                  Well, if you check the Qt documentation for QQmlEngine you will find out what you need to do :
                  QT += qml
                  http://doc.qt.io/qt-5/qqmlengine.html

                  embdevE Offline
                  embdevE Offline
                  embdev
                  wrote on last edited by
                  #8

                  @jsulm okies i'll give it a shot. Thank you!

                  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