D16516: [cuttlefish] Auto-focus on search textfield when app opens

Chris Holland noreply at phabricator.kde.org
Mon Oct 29 23:42:15 GMT 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20181029/8aaa42d7/attachment.html>


More information about the Plasma-devel mailing list