Zren added a comment.

  - https://doc.qt.io/qt-5.11/qml-qtquick-shortcut.html
  - http://doc.qt.io/qt-5/qkeysequence.html#StandardKey-enum
  - http://doc.qt.io/archives/qt-4.8/qkeysequence.html#standard-shortcuts
  - `QKeySequence::Quit`
  - http://doc.qt.io/qt-5/qml-qtqml-qt.html#quit-method
  
  So adding this shooooould work... but doesn't.
  
    // cuttlefish.qml
    import QtQuick 2.5
    Item {
        Shortcut {
            sequence: StandardKey.Quit
            onActivated: Qt.quit()
        }
    }
  
  We get:
  
    Signal QQmlEngine::quit() emitted, but no receivers connected to handle it.
  
  
  
  > to quit a C++ application when this method is called, connect the 
QQmlEngine::quit() signal to the QCoreApplication::quit() slot.
  
  Hmmm.
  
  Skimming Google/StackOverflow, we need to add:
  
    // main.cpp
    #include <QQmlEngine>
    QObject::connect(settingsapp->engine(), &QQmlEngine::quit, &app, 
&QApplication::quit);
  
  I wonder if we should be doing the shortcut in C++ as a QAction... oh well, 
discuss that in the patch. Patch incoming.

REPOSITORY
  R118 Plasma SDK

REVISION DETAIL
  https://phabricator.kde.org/D16516

To: Zren, ngraham
Cc: ngraham, plasma-devel, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart

Reply via email to