blob: 5fe348b1e80678bd9133eade9ca1e12ec8384f12 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
#pragma once
#include <QMouseEvent>
namespace QmlDesigner {
class Shortcut
{
public:
Shortcut();
Shortcut(QMouseEvent *event);
Shortcut(const Qt::KeyboardModifiers &mods, const Qt::Key &key);
Shortcut(const Qt::MouseButtons &buttons, const Qt::KeyboardModifiers &mods = Qt::NoModifier);
Shortcut(const Qt::MouseButtons &buttons, const Qt::KeyboardModifiers &mods, const Qt::Key &key);
bool exactMatch(const Qt::Key &key) const;
bool exactMatch(const Qt::MouseButton &button) const;
bool exactMatch(const Qt::KeyboardModifier &modifier) const;
bool operator==(const Shortcut &other) const;
private:
Qt::Key m_key;
Qt::MouseButtons m_buttons;
Qt::KeyboardModifiers m_modifiers;
};
} // End namespace QmlDesigner.
|