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
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
20
21#include <QtWidgets/qtoolbutton.h>
22
23#include <QtGui/qaction.h>
24
25#include <QtCore/qlist.h>
26#include <QtCore/qpoint.h>
27
28QT_BEGIN_NAMESPACE
29
30class QDesignerFormWindowInterface;
31class QToolBar;
32class QRect;
33class QAction;
34
35namespace qdesigner_internal {
36
37class 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
45
46public:
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
61
63
64 // Helper for task menu extension
66
68
69private slots:
71 void slotRemoveToolBar();
73
74private:
76
84
86 void adjustDragIndicator(const QPoint &pos);
87 void hideDragIndicator();
89 bool withinHandleArea(const QPoint &pos) const;
90
94};
95} // namespace qdesigner_internal
96
97QT_END_NAMESPACE
98
99#endif // QDESIGNER_TOOLBAR_H
int actionIndexAt(const Widget *w, const QPoint &pos, Qt::Orientation orientation)
virtual ~QDesignerActionProviderExtension()=default
virtual QRect actionGeometry(QAction *action) const =0
virtual QAction * actionAt(const QPoint &pos) const =0
virtual void adjustIndicator(const QPoint &pos)=0
#define QT_FORMEDITOR_EXPORT
Combined button and popup list for selecting options.
Auxiliary methods to store/retrieve settings.
static QRect verticalIndicatorRect(const QRect &rect)
static QRect horizontalIndicatorRect(const QRect &rect, Qt::LayoutDirection layoutDirection)
#define QDESIGNER_SHARED_EXPORT