1 /* 2 * DQt - D bindings for the Qt Toolkit 3 * 4 * GNU Lesser General Public License Usage 5 * This file may be used under the terms of the GNU Lesser 6 * General Public License version 3 as published by the Free Software 7 * Foundation and appearing in the file LICENSE.LGPL3 included in the 8 * packaging of this file. Please review the following information to 9 * ensure the GNU Lesser General Public License version 3 requirements 10 * will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 11 */ 12 module qt.widgets.keysequenceedit; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.coreevent; 17 import qt.core.namespace; 18 import qt.core.string; 19 import qt.gui.event; 20 import qt.gui.keysequence; 21 import qt.helpers; 22 import qt.widgets.widget; 23 24 /+ QT_REQUIRE_CONFIG(keysequenceedit); +/ 25 26 27 extern(C++, class) struct QKeySequenceEditPrivate; 28 /// Binding for C++ class [QKeySequenceEdit](https://doc.qt.io/qt-6/qkeysequenceedit.html). 29 class /+ Q_WIDGETS_EXPORT +/ QKeySequenceEdit : QWidget 30 { 31 mixin(Q_OBJECT); 32 /+ Q_PROPERTY(QKeySequence keySequence READ keySequence WRITE setKeySequence 33 NOTIFY keySequenceChanged USER true) +/ 34 35 public: 36 /+ explicit +/this(QWidget parent = null); 37 /+ explicit +/this(ref const(QKeySequence) keySequence, QWidget parent = null); 38 ~this(); 39 40 final QKeySequence keySequence() const; 41 42 public /+ Q_SLOTS +/: 43 @QSlot final void setKeySequence(ref const(QKeySequence) keySequence); 44 final void setKeySequence(const QString keySequence) 45 { 46 auto tmp = QKeySequence(keySequence); 47 setKeySequence(tmp); 48 } 49 @QSlot final void clear(); 50 51 /+ Q_SIGNALS +/public: 52 @QSignal final void editingFinished(); 53 @QSignal final void keySequenceChanged(ref const(QKeySequence) keySequence); 54 55 protected: 56 this(ref QKeySequenceEditPrivate d, QWidget parent, /+ Qt:: +/qt.core.namespace.WindowFlags f); 57 58 override bool event(QEvent ); 59 override void keyPressEvent(QKeyEvent ); 60 override void keyReleaseEvent(QKeyEvent ); 61 override void timerEvent(QTimerEvent ); 62 63 private: 64 /+ Q_DISABLE_COPY(QKeySequenceEdit) +/ 65 /+ Q_DECLARE_PRIVATE(QKeySequenceEdit) +/ 66 mixin(CREATE_CONVENIENCE_WRAPPERS); 67 } 68