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
toolbar_taskmenu.cpp
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4
#
include
"toolbar_taskmenu.h"
5
#
include
"qdesigner_toolbar_p.h"
6
7
#
include
<
QtDesigner
/
abstractformwindow
.
h
>
8
9
#
include
<
promotiontaskmenu_p
.
h
>
10
#
include
<
qdesigner_command_p
.
h
>
11
12
#
include
<
QtGui
/
qaction
.
h
>
13
#
include
<
QtGui
/
qundostack
.
h
>
14
15
#
include
<
QtCore
/
qdebug
.
h
>
16
17
QT_BEGIN_NAMESPACE
18
19
namespace
qdesigner_internal
{
20
// ------------ ToolBarTaskMenu
21
ToolBarTaskMenu
::ToolBarTaskMenu(QToolBar *tb, QObject *parent) :
22
QObject(parent),
23
m_toolBar(tb)
24
{
25
}
26
27
QAction *
ToolBarTaskMenu
::
preferredEditAction
()
const
28
{
29
return
nullptr
;
30
}
31
32
QList
<
QAction
*>
ToolBarTaskMenu
::
taskActions
()
const
33
{
34
if
(ToolBarEventFilter *ef = ToolBarEventFilter::eventFilterOf(m_toolBar))
35
return
ef->contextMenuActions();
36
return
{};
37
}
38
39
// ------------ StatusBarTaskMenu
40
StatusBarTaskMenu
::StatusBarTaskMenu(QStatusBar *sb, QObject *parent) :
41
QObject(parent),
42
m_statusBar(sb),
43
m_removeAction(
new
QAction(tr(
"Remove"
),
this
)),
44
m_promotionTaskMenu(
new
PromotionTaskMenu(sb, PromotionTaskMenu::ModeSingleWidget,
this
))
45
{
46
connect(m_removeAction, &QAction::triggered,
this
, &StatusBarTaskMenu::removeStatusBar);
47
}
48
49
QAction *
StatusBarTaskMenu
::
preferredEditAction
()
const
50
{
51
return
nullptr
;
52
}
53
54
QList
<
QAction
*>
StatusBarTaskMenu
::
taskActions
()
const
55
{
56
QList<QAction*> rc;
57
rc.push_back(m_removeAction);
58
m_promotionTaskMenu->addActions(PromotionTaskMenu::LeadingSeparator, rc);
59
return
rc;
60
}
61
62
void
StatusBarTaskMenu
::removeStatusBar()
63
{
64
if
(QDesignerFormWindowInterface *fw = QDesignerFormWindowInterface::findFormWindow(m_statusBar)) {
65
DeleteStatusBarCommand *cmd =
new
DeleteStatusBarCommand(fw);
66
cmd->init(m_statusBar);
67
fw->commandHistory()->push(cmd);
68
}
69
}
70
}
71
72
QT_END_NAMESPACE
qdesigner_internal::StatusBarTaskMenu
Definition
toolbar_taskmenu.h:36
qdesigner_internal::StatusBarTaskMenu::taskActions
QList< QAction * > taskActions() const override
Definition
toolbar_taskmenu.cpp:54
qdesigner_internal::StatusBarTaskMenu::preferredEditAction
QAction * preferredEditAction() const override
Definition
toolbar_taskmenu.cpp:49
qdesigner_internal::ToolBarTaskMenu
Definition
toolbar_taskmenu.h:21
qdesigner_internal::ToolBarTaskMenu::preferredEditAction
QAction * preferredEditAction() const override
Definition
toolbar_taskmenu.cpp:27
qdesigner_internal::ToolBarTaskMenu::taskActions
QList< QAction * > taskActions() const override
Definition
toolbar_taskmenu.cpp:32
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
qdesigner_internal
Auxiliary methods to store/retrieve settings.
Definition
buddyeditor.cpp:66
qttools
src
designer
src
components
taskmenu
toolbar_taskmenu.cpp
Generated on Sat Sep 21 2024 00:50:27 for Qt by
1.12.0