DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
shortcutedit.h
1// SPDX-FileCopyrightText: 2016 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#pragma once
6
7#include <QScopedPointer>
8#include <QWidget>
9
11class ShortcutEdit : public QWidget
12{
13 Q_OBJECT
14public:
15 explicit ShortcutEdit(QWidget *parent = 0);
17
18 void setShortCut(Qt::KeyboardModifiers modifier, Qt::Key key);
19 void setShortCut(const QString &sequenceString);
20
21Q_SIGNALS:
22 // WARINNG: just connect one of this on one time
23 // these two signal will send at them same time
24 void shortcutChanged(Qt::KeyboardModifiers modifier, Qt::Key key);
25 void shortcutStringChanged(const QString &sequenceString);
26
27protected:
28 virtual void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
29 virtual void focusInEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
30 virtual void focusOutEvent(QFocusEvent *e) Q_DECL_OVERRIDE;
31 virtual void keyPressEvent(QKeyEvent *e) Q_DECL_OVERRIDE;
32 virtual void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
33
34 void notifyShortcutChanged(Qt::KeyboardModifiers modifier, Qt::Key key);
35
36private:
37 QScopedPointer<ShortcutEditPrivate> d_ptr;
38 Q_DECLARE_PRIVATE_D(qGetPtrHelper(d_ptr), ShortcutEdit)
39};
40
Definition shortcutedit.cpp:36
Definition shortcutedit.h:12