swift
Loading...
Searching...
No Matches
shortcut.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2015 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3// Class based on qLed: Copyright (C) 2010 by P. Sereno, http://www.sereno-online.com
4
5#include "gui/shortcut.h"
6
7#include <QKeySequence>
8#include <Qt>
9
10namespace swift::gui
11{
13 {
14 static const QKeySequence k(static_cast<Qt::Key>(Qt::ALT) + Qt::Key_S);
15 return k;
16 }
17
19 {
20 static const QKeySequence k(static_cast<Qt::Key>(Qt::ALT) + Qt::Key_A);
21 return k;
22 }
23
25 {
26 static const QKeySequence k(static_cast<Qt::Key>(Qt::CTRL) + Qt::Key_Space);
27 return k;
28 }
29
31 {
32 static const QKeySequence k(static_cast<Qt::Key>(Qt::CTRL) + Qt::Key_A);
33 return k;
34 }
35
37 {
38 static const QKeySequence k(static_cast<Qt::Key>(Qt::CTRL) + Qt::Key_F);
39 return k;
40 }
41
43 {
44 static const QKeySequence k(static_cast<Qt::Key>(Qt::CTRL) + Qt::Key_R);
45 return k;
46 }
47
49 {
50 static const QKeySequence k(static_cast<Qt::Key>(Qt::CTRL) + Qt::Key_S);
51 return k;
52 }
53
55 {
56 // remark CTRL+S not working in views
57 static const QKeySequence k(static_cast<Qt::Key>(Qt::SHIFT) + Qt::Key_S);
58 return k;
59 }
60
62 {
63 static const QKeySequence k(Qt::Key_Delete);
64 return k;
65 }
66
68 {
69 static const QKeySequence k(Qt::Key_Escape);
70 return k;
71 }
72
74 {
75 static const QKeySequence k(static_cast<Qt::Key>(Qt::CTRL) + Qt::Key_C);
76 return k;
77 }
78
80 {
81 static const QKeySequence k(static_cast<Qt::Key>(Qt::CTRL) + Qt::Key_Plus);
82 return k;
83 }
84
86 {
87 static const QKeySequence k(static_cast<Qt::Key>(Qt::CTRL) + Qt::Key_Minus);
88 return k;
89 }
90
92 {
93 static const QKeySequence k(static_cast<Qt::Key>(Qt::CTRL) + Qt::Key_0);
94 return k;
95 }
96
98 {
99 return QStringLiteral("(%1)").arg(sequence.toString());
100 }
101} // namespace swift::gui
static const QKeySequence & keyFontPlus()
Font plus.
Definition shortcut.cpp:79
static const QKeySequence & keySave()
Save depending on context.
Definition shortcut.cpp:48
static const QKeySequence & keyDelete()
Delete, e.g. selected rows.
Definition shortcut.cpp:61
static const QKeySequence & keyFontReset()
Font reset.
Definition shortcut.cpp:91
static const QKeySequence & keyEscape()
Escape.
Definition shortcut.cpp:67
static const QKeySequence & keyStash()
For stashing models.
Definition shortcut.cpp:12
static const QKeySequence & keySelectAll()
For selecting all.
Definition shortcut.cpp:30
static const QKeySequence & keyResizeView()
Resize view.
Definition shortcut.cpp:42
static const QKeySequence & keyAddToModelSet()
Add to model set.
Definition shortcut.cpp:18
static const QKeySequence & keyDisplayFilter()
Display filter.
Definition shortcut.cpp:36
static const QKeySequence & keyClearSelection()
For deselecting all.
Definition shortcut.cpp:24
static const QKeySequence & keyCopy()
Copy.
Definition shortcut.cpp:73
static QString toParenthesisString(const QKeySequence &sequence)
As string for menus etc. Looks like "(CTRL + R)".
Definition shortcut.cpp:97
static const QKeySequence & keySaveViews()
Save in views.
Definition shortcut.cpp:54
static const QKeySequence & keyFontMinus()
Font minus.
Definition shortcut.cpp:85
GUI related classes.
QString toString(QKeySequence::SequenceFormat format) const const
QString arg(Args &&... args) const const