Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qdesigner_toolbar_p.h
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
// Qt-Security score:significant reason:default
4
5
//
6
// W A R N I N G
7
// -------------
8
//
9
// This file is not part of the Qt API. It exists for the convenience
10
// of Qt Designer. This header
11
// file may change from version to version without notice, or even be removed.
12
//
13
// We mean it.
14
//
15
16
#
ifndef
QDESIGNER_TOOLBAR_H
17
#
define
QDESIGNER_TOOLBAR_H
18
19
#
include
"shared_global_p.h"
20
21
#
include
<
QtWidgets
/
qtoolbutton
.
h
>
22
23
#
include
<
QtGui
/
qaction
.
h
>
24
25
#
include
<
QtCore
/
qlist
.
h
>
26
#
include
<
QtCore
/
qpoint
.
h
>
27
28
QT_BEGIN_NAMESPACE
29
30
class
QDesignerFormWindowInterface;
31
class
QToolBar;
32
class
QRect;
33
class
QAction;
34
35
namespace
qdesigner_internal
{
36
37
class
PromotionTaskMenu;
38
39
// Special event filter for tool bars in designer.
40
// Handles drag and drop to and from. Ensures that each
41
// child widget is WA_TransparentForMouseEvents to enable drag and drop.
42
43
class
QDESIGNER_SHARED_EXPORT
ToolBarEventFilter
:
public
QObject
{
44
Q_OBJECT
45
46
public
:
47
static
void
install
(
QToolBar
*
tb
);
48
49
// Find action by position. Note that QToolBar::actionAt() will
50
// not work as designer sets WA_TransparentForMouseEvents on its tool bar buttons
51
// to be able to drag them. This function will return the dummy
52
// sentinel action when applied to tool bars created by designer if the position matches.
53
static
QAction
*
actionAt
(
const
QToolBar
*
tb
,
const
QPoint
&
pos
);
54
55
static
bool
withinHandleArea
(
const
QToolBar
*
tb
,
const
QPoint
&
pos
);
56
static
QRect
handleArea
(
const
QToolBar
*
tb
);
57
static
QRect
freeArea
(
const
QToolBar
*
tb
);
58
59
// Utility to create an action
60
static
QAction
*
createAction
(
QDesignerFormWindowInterface
*
fw
,
const
QString
&
objectName
,
bool
separator
);
61
62
bool
eventFilter
(
QObject
*
watched
,
QEvent
*
event
)
override
;
63
64
// Helper for task menu extension
65
QList
<
QAction
*>
contextMenuActions
(
const
QPoint
&
globalPos
=
QPoint
(-1, -1));
66
67
static
ToolBarEventFilter
*
eventFilterOf
(
const
QToolBar
*
tb
);
68
69
private
slots
:
70
void
slotRemoveSelectedAction
();
71
void
slotRemoveToolBar
();
72
void
slotInsertSeparator
();
73
74
private
:
75
explicit
ToolBarEventFilter
(
QToolBar
*
tb
);
76
77
bool
handleContextMenuEvent
(
QContextMenuEvent
*
event
);
78
bool
handleDragEnterMoveEvent
(
QDragMoveEvent
*
event
);
79
bool
handleDragLeaveEvent
(
QDragLeaveEvent
*);
80
bool
handleDropEvent
(
QDropEvent
*
event
);
81
bool
handleMousePressEvent
(
QMouseEvent
*
event
);
82
bool
handleMouseReleaseEvent
(
QMouseEvent
*
event
);
83
bool
handleMouseMoveEvent
(
QMouseEvent
*
event
);
84
85
QDesignerFormWindowInterface
*
formWindow
()
const
;
86
void
adjustDragIndicator
(
const
QPoint
&
pos
);
87
void
hideDragIndicator
();
88
bool
startDrag
(
const
QPoint
&
pos
,
Qt
::
KeyboardModifiers
modifiers
);
89
bool
withinHandleArea
(
const
QPoint
&
pos
)
const
;
90
91
QToolBar
*
m_toolBar
;
92
PromotionTaskMenu
*
m_promotionTaskMenu
;
93
QPoint
m_startPosition
;
94
};
95
}
// namespace qdesigner_internal
96
97
QT_END_NAMESPACE
98
99
#
endif
// QDESIGNER_TOOLBAR_H
actionIndexAt
int actionIndexAt(const Widget *w, const QPoint &pos, Qt::Orientation orientation)
Definition
actionprovider_p.h:43
QDesignerActionProviderExtension
Definition
actionprovider_p.h:29
QDesignerActionProviderExtension::~QDesignerActionProviderExtension
virtual ~QDesignerActionProviderExtension()=default
QDesignerActionProviderExtension::actionGeometry
virtual QRect actionGeometry(QAction *action) const =0
QDesignerActionProviderExtension::actionAt
virtual QAction * actionAt(const QPoint &pos) const =0
QDesignerActionProviderExtension::adjustIndicator
virtual void adjustIndicator(const QPoint &pos)=0
qdesigner_internal::ToolBarEventFilter
Definition
qdesigner_toolbar_p.h:43
QT_FORMEDITOR_EXPORT
#define QT_FORMEDITOR_EXPORT
Definition
formeditor_global.h:17
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qdesigner_internal
Auxiliary methods to store/retrieve settings.
Definition
buddyeditor.cpp:67
qdesigner_internal::verticalIndicatorRect
static QRect verticalIndicatorRect(const QRect &rect)
Definition
default_actionprovider.cpp:51
qdesigner_internal::horizontalIndicatorRect
static QRect horizontalIndicatorRect(const QRect &rect, Qt::LayoutDirection layoutDirection)
Definition
default_actionprovider.cpp:41
qdesigner_internal::indicatorSize
@ indicatorSize
Definition
default_actionprovider.cpp:37
QDESIGNER_SHARED_EXPORT
#define QDESIGNER_SHARED_EXPORT
Definition
shared_global_p.h:33
qttools
src
designer
src
lib
shared
qdesigner_toolbar_p.h
Generated on
for Qt by
1.18.0