Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtoolbarlayout_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 LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QTOOLBARLAYOUT_P_H
5#define QTOOLBARLAYOUT_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtWidgets/private/qtwidgetsglobal_p.h>
19#include <QtWidgets/qlayout.h>
20#include <private/qlayoutengine_p.h>
21#include <QList>
22
24
26
27class QAction;
29class QMenu;
30
32{
33public:
35 bool isEmpty() const override;
36
39};
40
41class QToolBarLayout : public QLayout
42{
44
45public:
46 QToolBarLayout(QWidget *parent = nullptr);
48
49 void addItem(QLayoutItem *item) override;
50 QLayoutItem *itemAt(int index) const override;
51 QLayoutItem *takeAt(int index) override;
52 int count() const override;
53
54 bool isEmpty() const override;
55 void invalidate() override;
56 Qt::Orientations expandingDirections() const override;
57
58 void setGeometry(const QRect &r) override;
59 QSize minimumSize() const override;
60 QSize sizeHint() const override;
61
62 void insertAction(int index, QAction *action);
63 int indexOf(const QAction *action) const;
64 using QLayout::indexOf; // bring back the hidden members
65
66 bool layoutActions(const QSize &size);
67 QSize expandedSize(const QSize &size) const;
69
70 void setUsePopupMenu(bool set); // Yeah, there's no getter, but it's internal.
71 void checkUsePopupMenu();
72
73 bool movable() const;
75 bool hasExpandFlag() const;
76
78public Q_SLOTS:
79 void setExpanded(bool b);
80
81private:
82 QList<QToolBarItem*> items;
83 QSize hint, minSize;
84 bool dirty, expanding, empty, expandFlag;
85 QList<QLayoutStruct> geomArray;
86 QRect handRect;
87 QToolBarExtension *extension;
88
89 void updateGeomArray() const;
90 QToolBarItem *createItem(QAction *action);
91 QMenu *popupMenu;
92};
93
95
96#endif // QTOOLBARLAYOUT_P_H
The QAction class provides an abstraction for user commands that can be added to different user inter...
Definition qaction.h:30
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition qlayoutitem.h:25
The QLayout class is the base class of geometry managers.
Definition qlayout.h:26
virtual int indexOf(const QWidget *) const
Searches for widget widget in this layout (not including child layouts).
Definition qlayout.cpp:1177
The QMenu class provides a menu widget for use in menu bars, context menus, and other popup menus.
Definition qmenu.h:26
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
bool isEmpty() const override
Implemented in subclasses to return whether this item is empty, i.e.
QToolBarItem(QWidget *widget)
void setGeometry(const QRect &r) override
\reimp
QSize sizeHint() const override
Implemented in subclasses to return the preferred size of this item.
bool layoutActions(const QSize &size)
void addItem(QLayoutItem *item) override
Implemented in subclasses to add an item.
QLayoutItem * takeAt(int index) override
Must be implemented in subclasses to remove the layout item at index from the layout,...
int count() const override
Must be implemented in subclasses to return the number of items in the layout.
void updateMacBorderMetrics()
void setUsePopupMenu(bool set)
void insertAction(int index, QAction *action)
bool isEmpty() const override
\reimp
void setExpanded(bool b)
int indexOf(const QAction *action) const
QToolBarLayout(QWidget *parent=nullptr)
void invalidate() override
\reimp
void updateMarginAndSpacing()
QSize expandedSize(const QSize &size) const
bool hasExpandFlag() const
Qt::Orientations expandingDirections() const override
Returns whether this layout can make use of more space than sizeHint().
bool movable() const
QLayoutItem * itemAt(int index) const override
Must be implemented in subclasses to return the layout item at index.
QSize minimumSize() const override
Returns the minimum size of this layout.
The QWidgetItem class is a layout item that represents a widget.
Definition qlayoutitem.h:86
QWidget * widget() const override
Returns the widget managed by this item.
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
Combined button and popup list for selecting options.
GLboolean GLboolean GLboolean b
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLboolean r
[2]
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
#define Q_SLOTS
QFuture< QSet< QChar > > set
[10]
QGraphicsItem * item