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

Better to document "-widgets" argument in QUICK_TEST_MAIN and etc

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.11.3
    • Fix Version/s: None
    • Labels:
      None

      Description

      The two macros QUICK_TEST_MAIN and QUICK_TEST_MAIN_WITH_SETUP do not let us chose between QApplication or QGuiApplication. There is no easy way to test a UI containing a chart for now.

      All such QGuiApplication instances in the project must be replaced with QApplication as the module depends on Qt's Graphics View Framework for rendering.

      Note : I also went through this trouble reported here : https://bugreports.qt.io/browse/QTBUG-74160

      See also https://github.com/qt/qtdeclarative/blob/5.15/src/qmltest/quicktest.cpp#L370-L381

      int quick_test_main_with_setup(int argc, char **argv, const char *name, const char *sourceDir, QObject *setup)
      {
          // Peek at arguments to check for '-widgets' argument
      #ifdef QT_QMLTEST_WITH_WIDGETS
          bool withWidgets = false;
          for (int index = 1; index < argc; ++index) {
              if (strcmp(argv[index], "-widgets") == 0) {
                  withWidgets = true;
                  break;
              }
          }
      #endif
      

        Attachments

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

          Activity

            People

            Assignee:
            docteam Qt Documentation Team
            Reporter:
            jgueytat JulienGueytat
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes