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

QShortcut fires multiple times when WebEngine used on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.10.0
    • WebEngine
    • None
    • macOS 10.13
    • macOS

    Description

      Apply the attached patch to simplebrowser and observe multiple lines of output when the 's' key is pressed. Event appears to fire only once on a different example program that doesn't use WebEngine. This didn't happen in 5.9, and doesn't happen on Linux, so it appears to be a regression on macOS.

       --- simplebrowser-orig/browserwindow.cpp 2017-11-29 18:42:28.000000000 +1000
      +++ simplebrowser/browserwindow.cpp 2017-12-14 15:10:58.000000000 +1000
      @@ -66,6 +66,7 @@
      #include <QToolBar>
      #include <QVBoxLayout>
      #include <QWebEngineProfile>
      +#include <QShortcut>

      BrowserWindow::BrowserWindow(Browser *browser, QWebEngineProfile *profile)
      : m_browser(browser)
      @@ -91,6 +92,11 @@
      menuBar()->addMenu(createWindowMenu(m_tabWidget));
      menuBar()->addMenu(createHelpMenu());

      + QShortcut *scut = new QShortcut(QKeySequence("s"), this);
      + connect(scut, &QShortcut::activated, [this]()

      { + qInfo("activated"); + }

      );
      +
      QWidget *centralWidget = new QWidget(this);
      QVBoxLayout *layout = new QVBoxLayout;
      layout->setSpacing(0);

      Attachments

        Issue Links

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

          Activity

            People

              mibrunin Michael Bruning
              qtdae2 Damien Elmes
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes