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

Reg->6.10: QKeySequence::isEmpty() changed semantics and/or Windows platform Quit key changed

    XMLWordPrintable

Details

    • Windows

    Description

      The code commonly used to achieve a common Ctrl-Q Quit shortcut (on Windows, where the standard key was empty in 6.9) no longer works in 6.10:

          auto ks = QKeySequence(QKeySequence::Quit);
          qDebug() << ks << "empty=" << ks.isEmpty();
          if (ks.isEmpty())
              ks = QKeySequence(Qt::CTRL | Qt::Key_Q);
          else
              qDebug() << "key=" << ks[0];
          auto *qa = fm->addAction("Quit", ks, &w, &QWidget::close);
          qDebug() << "act" << qa->shortcut();
      

      now produces

      6.10.0 windows windows11 QList()
      QKeySequence("Exit")  empty= false
      act QKeySequence("Exit")
      key= QKeyCombination(QFlags<Qt::KeyboardModifier>(NoModifier), Qt::Key_Exit)
      act QKeySequence("Exit")
      

      (not working) as opposed to

      6.9.1 windows windows11 QList()
      QKeySequence("")  empty= true
      act QKeySequence("Ctrl+Q")
      

      Attachments

        1. qtbug138383.zip
          1 kB
          Friedemann Kleint

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              kleint Friedemann Kleint
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes