Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
src_gui_widgets_qmenu.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
4//! [0]
5exec(QCursor::pos());
6//! [0]
7
8
9//! [1]
10exec(somewidget.mapToGlobal(QPoint(0,0)));
11//! [1]
12
13
14//! [2]
15exec(e->globalPosition().toPoint());
16//! [2]
17
18
19//! [3]
20exec(QCursor::pos());
21//! [3]
22
23
24//! [4]
25exec(somewidget.mapToGlobal(QPoint(0, 0)));
26//! [4]
27
28
29//! [5]
30exec(e->globalPosition().toPoint());
31//! [5]
32
33
34//! [6]
36QAction *at = actions[0]; // Assumes actions is not empty
37for (QAction *a : std::as_const(actions))
38 menu.addAction(a);
39menu.exec(pos, at);
40//! [6]
QMenu menu
[5]
exec(somewidget.mapToGlobal(QPoint(0, 0)))
[0]
QAction * at