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
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists for the convenience
9// of Qt Designer. This header
10// file may change from version to version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef QDESIGNER_TOOLBAR_H
16#define QDESIGNER_TOOLBAR_H
17
19
20#include <QtWidgets/qtoolbutton.h>
21
22#include <QtGui/qaction.h>
23
24#include <QtCore/qlist.h>
25#include <QtCore/qpoint.h>
26
27QT_BEGIN_NAMESPACE
28
29class QDesignerFormWindowInterface;
30class QToolBar;
31class QRect;
32class QAction;
33
34namespace qdesigner_internal {
35
36class PromotionTaskMenu;
37
38// Special event filter for tool bars in designer.
39// Handles drag and drop to and from. Ensures that each
40// child widget is WA_TransparentForMouseEvents to enable drag and drop.
41
44
45public:
46 static void install(QToolBar *tb);
47
48 // Find action by position. Note that QToolBar::actionAt() will
49 // not work as designer sets WA_TransparentForMouseEvents on its tool bar buttons
50 // to be able to drag them. This function will return the dummy
51 // sentinel action when applied to tool bars created by designer if the position matches.
52 static QAction *actionAt(const QToolBar *tb, const QPoint &pos);
53
54 static bool withinHandleArea(const QToolBar *tb, const QPoint &pos);
55 static QRect handleArea(const QToolBar *tb);
56 static QRect freeArea(const QToolBar *tb);
57
58 // Utility to create an action
60
62
63 // Helper for task menu extension
65
67
68private slots:
70 void slotRemoveToolBar();
72
73private:
75
83
85 void adjustDragIndicator(const QPoint &pos);
86 void hideDragIndicator();
88 bool withinHandleArea(const QPoint &pos) const;
89
93};
94} // namespace qdesigner_internal
95
96QT_END_NAMESPACE
97
98#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