DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dkeysequenceedit.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DKEYSEQUENCEEDIT_H
6#define DKEYSEQUENCEEDIT_H
7
8#include <dobject.h>
9#include <dtkwidget_global.h>
10
11#include <QKeySequenceEdit>
12#include <QLineEdit>
13
14DWIDGET_BEGIN_NAMESPACE
15
16class DKeySequenceEditPrivate;
17class LIBDTKWIDGETSHARED_EXPORT DKeySequenceEdit : public QLineEdit, public DTK_CORE_NAMESPACE::DObject
18{
19 Q_OBJECT
20 Q_DISABLE_COPY(DKeySequenceEdit)
21 D_DECLARE_PRIVATE(DKeySequenceEdit)
22
23public:
24 explicit DKeySequenceEdit(QWidget *parent = nullptr);
25
26 void clear();
27 bool setKeySequence(const QKeySequence &keySequence);
28 QKeySequence keySequence();
29 void ShortcutDirection(Qt::AlignmentFlag alig);
30
31 QString getKeySequence(QKeySequence sequence);
32
33Q_SIGNALS:
34 void editingFinished(const QKeySequence &keySequence);
35 void keySequenceChanged(const QKeySequence &keySequence);
36
37protected:
38 void keyPressEvent(QKeyEvent *event) override;
39 bool event(QEvent *e) override;
40};
41
42DWIDGET_END_NAMESPACE
43
44#endif // DKEYSEQUENCEEDIT_H
45
46
Definition dkeysequenceedit.h:18