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

    • Windows

      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")
      

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

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

              Created:
              Updated:

                There are no open Gerrit changes