Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
src_gui_kernel_qshortcut.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
5shortcut = new QShortcut(QKeySequence(tr("Ctrl+O", "File|Open")),
6 parent);
8
9
11setKey(0); // no signal emitted
12setKey(QKeySequence()); // no signal emitted
13setKey(0x3b1); // Greek letter alpha
14setKey(Qt::Key_D); // 'd', e.g. to delete
15setKey('q'); // 'q', e.g. to quit
16setKey(Qt::CTRL | Qt::Key_P); // Ctrl+P, e.g. to print document
17setKey("Ctrl+P"); // Ctrl+P, e.g. to print document
The QKeySequence class encapsulates a key sequence as used by shortcuts.
The QShortcut class is used to create keyboard shortcuts.
Definition qshortcut.h:19
@ CTRL
@ Key_D
Definition qnamespace.h:549
@ Key_P
Definition qnamespace.h:561
#define tr(X)
setKey(0)
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent