Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-97824

Unable to determine should be used QGuiApplication or QApplication in a QtQuick application

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • Not Evaluated
    • None
    • 6.2.1
    • Quick: Other
    • None
    • All

    Description

      When I create a new QtQuick project, if this program doesn't need to use QWidget, then i think should use the QGuiAppliction for it. However, I hope this program is cross-platform, in order to more in line with platform themes, the best choice is the Qt.Labs.platform module when using controls such as Menu or FileDialog. However, if the "createPlatformXXX" interfaces is not implemented in the platform theme plugin, qt.labs.platform will always fallback to use the QWidget, and if this program does not use QApplication, in this environment, it will not display menus and dialogs, In order to avoid such problems, the program can only be forced to use QApplication, but the QApplication is more complicated relative to the QGuiApplication, it has more codes, create a QApplication is slower than create QGuiApplication, it will influence this program start speed. Before using qt.labs.platform, there is no way to know if it needs to fallback to use the QWidget, the platform theme plugin is extensible, outside the qtbase projects, there are many Linux Desktop Environment to provide custom platform theme plugins, the platform menu and platform dialogs may be provided in the plug-in, but these are uncertain, so once a program import the qt.labs.platform module, then there is only QApplication (even if the program is not use the QApplication when running) . If qt.labs.platform is not always fallbak to QWidget, and can notify the program control when creating fails, then the program can choose fallback to QtQuick.Controls Menu or a custom Menu control, which, the program can be determined that it is always enough use QGuiApplication, not because there may be problems, it can only use the QApplication.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              zccrs JiDe Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes