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]
5
exec(QCursor::pos());
6
//! [0]
7
8
9
//! [1]
10
exec
(somewidget.mapToGlobal(QPoint(0,0)));
11
//! [1]
12
13
14
//! [2]
15
exec
(e->globalPosition().toPoint());
16
//! [2]
17
18
19
//! [3]
20
exec(QCursor::pos());
21
//! [3]
22
23
24
//! [4]
25
exec
(somewidget.mapToGlobal(QPoint(0, 0)));
26
//! [4]
27
28
29
//! [5]
30
exec
(e->globalPosition().toPoint());
31
//! [5]
32
33
34
//! [6]
35
QMenu
menu
;
36
QAction
*
at
= actions[0];
// Assumes actions is not empty
37
for
(QAction *a : std::as_const(actions))
38
menu.addAction(a);
39
menu.exec(pos, at);
40
//! [6]
menu
QMenu menu
[5]
Definition
src_gui_widgets_qmenu.cpp:35
exec
exec(somewidget.mapToGlobal(QPoint(0, 0)))
[0]
at
QAction * at
Definition
src_gui_widgets_qmenu.cpp:36
qtbase
src
widgets
doc
snippets
code
src_gui_widgets_qmenu.cpp
Generated on Thu Nov 14 2024 00:46:12 for Qt by
1.12.0