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

QKeyCombination fails to pass tst_QKeySequence::toStringFromKeycode_data

    XMLWordPrintable

Details

    Description

      In the test case tst_QKeySequence::toStringFromKeycode_data, a QKeySequence is attempted constructed like this:

      QKeySequence(Qt::Key_Insert | Qt::KeypadModifier | Qt::ControlModifier)

      This, however, triggers the QT6 deprecated warning on compilation, effectively failing the test. It works perfectly fine if the modifiers come first, though.

      Here is the build warning:

      [1454/4030] Building CXX object tests/auto/gui/kernel/qkeysequence/CMakeFiles/tst_qkeysequence.dir/tst_qkeysequence.cpp.o
      /Users/dskoland/qt/qt5-tests/qtbase/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp:505:54: warning: 'operator int' is deprecated: Use QKeyCombination instead of int [-Wdeprecated-declarations]
          QTest::newRow("Ctrl+Num+Ins(1)") << QKeySequence(Qt::Key_Insert | Qt::KeypadModifier | Qt::ControlModifier) << "Ctrl+Num+Ins";
                                                           ^
      include/QtCore/../../../qtbase/src/corelib/global/qnamespace.h:1911:5: note: 'operator int' has been explicitly marked deprecated here
          QT_DEPRECATED_VERSION_X(6, 0, "Use QKeyCombination instead of int")
          ^
      include/QtCore/../../../qtbase/src/corelib/global/qglobal.h:370:53: note: expanded from macro 'QT_DEPRECATED_VERSION_X'
      #define QT_DEPRECATED_VERSION_X(major, minor, text) QT_DEPRECATED_VERSION_X_##major##_##minor(text)
                                                          ^
      <scratch space>:221:1: note: expanded from here
      QT_DEPRECATED_VERSION_X_6_0
      ^
      include/QtCore/../../../qtbase/src/corelib/global/qglobal.h:362:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_0'
      # define QT_DEPRECATED_VERSION_X_6_0(text) QT_DEPRECATED_X(text)
                                                 ^
      include/QtCore/../../../qtbase/src/corelib/global/qglobal.h:274:33: note: expanded from macro 'QT_DEPRECATED_X'
      #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                      ^
      include/QtCore/../../../qtbase/src/corelib/global/qcompilerdetection.h:1153:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
      #  define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
                                         ^
      1 warning generated.
      

      Attachments

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

        Activity

          People

            srutledg Shawn Rutledge
            david.skoland David Skoland
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes