45 #ifndef QT_NO_MAINWINDOW 69 #include <private/qapplication_p.h> 70 #include <private/qlayoutengine_p.h> 72 # include <private/qcore_mac_p.h> 73 # include <private/qt_cocoa_helpers_mac_p.h> 76 #ifdef QT_NO_DOCKWIDGET 80 #ifdef Q_DEBUG_MAINWINDOW_LAYOUT 81 # include <QTextStream> 90 #if defined(Q_DEBUG_MAINWINDOW_LAYOUT) && !defined(QT_NO_DOCKWIDGET) 98 qout << indent <<
"QDockAreaLayoutItem: " 99 <<
"pos: " << item.
pos <<
" size:" << item.
size 104 qout << indent <<
"widget: " 107 }
else if (item.
subinfo != 0) {
108 qout << indent <<
"subinfo:\n";
112 qout << indent <<
"placeHolder: " 113 <<
"pos: " << item.
pos <<
" size:" << item.
size 119 <<
" rect:" << r.
x() <<
',' << r.
y() <<
' ' 127 qout << indent <<
"QDockAreaLayoutInfo: " 132 <<
" orient:" << layout.
o 133 <<
" tabbed:" << layout.
tabbed 139 qout << indent <<
"Item: " << i <<
'\n';
147 qout << indent <<
"QDockAreaLayout: " 153 qout << indent <<
"TopDockArea:\n";
155 qout << indent <<
"LeftDockArea:\n";
157 qout << indent <<
"RightDockArea:\n";
159 qout << indent <<
"BottomDockArea:\n";
171 #endif // Q_DEBUG_MAINWINDOW_LAYOUT && !QT_NO_DOCKWIDGET 182 toolBarAreaLayout(win),
199 #ifndef QT_NO_DOCKWIDGET 202 if (centralWidgetItem != 0)
203 result = centralWidgetItem->sizeHint();
206 #ifndef QT_NO_TOOLBAR 208 #endif // QT_NO_TOOLBAR 217 #ifndef QT_NO_DOCKWIDGET 220 if (centralWidgetItem != 0)
221 result = centralWidgetItem->minimumSize();
224 #ifndef QT_NO_TOOLBAR 226 #endif // QT_NO_TOOLBAR 233 #ifndef QT_NO_TOOLBAR 237 #ifndef QT_NO_DOCKWIDGET 241 if (centralWidgetItem != 0) {
257 #endif // QT_NO_TOOLBAR 259 #ifndef QT_NO_DOCKWIDGET 263 centralWidgetRect = r;
269 #ifndef QT_NO_TOOLBAR 273 #ifndef QT_NO_DOCKWIDGET 280 #ifndef QT_NO_DOCKWIDGET 284 delete centralWidgetItem;
285 centralWidgetItem = 0;
291 #ifndef QT_NO_TOOLBAR 296 #ifndef QT_NO_DOCKWIDGET 300 if (centralWidgetItem != 0 && (*x)++ ==
index)
301 return centralWidgetItem;
309 #ifndef QT_NO_TOOLBAR 314 #ifndef QT_NO_DOCKWIDGET 318 if (centralWidgetItem != 0 && (*x)++ ==
index) {
320 centralWidgetItem = 0;
332 #ifndef QT_NO_TOOLBAR 334 if (
QToolBar *toolBar = qobject_cast<QToolBar*>(widget)) {
342 #ifndef QT_NO_DOCKWIDGET 344 if (
QDockWidget *dockWidget = qobject_cast<QDockWidget *>(widget)) {
350 #endif //QT_NO_DOCKWIDGET 357 #ifndef QT_NO_DOCKWIDGET 363 if (centralWidgetItem != 0 && centralWidgetItem->widget() ==
widget)
367 #ifndef QT_NO_TOOLBAR 383 #ifndef QT_NO_DOCKWIDGET 386 centralWidgetItem =
item;
394 #ifndef QT_NO_DOCKWIDGET 397 item = centralWidgetItem;
410 #ifndef QT_NO_TOOLBAR 412 if (qobject_cast<QToolBar*>(widget) != 0) {
420 #ifndef QT_NO_DOCKWIDGET 422 if (qobject_cast<QDockWidget *>(widget) != 0) {
428 #endif //QT_NO_DOCKWIDGET 438 int i = path.
first();
440 #ifndef QT_NO_TOOLBAR 447 #ifndef QT_NO_DOCKWIDGET 452 #endif //QT_NO_DOCKWIDGET 459 int i = path.
first();
461 #ifndef QT_NO_TOOLBAR 466 #ifndef QT_NO_DOCKWIDGET 469 #endif //QT_NO_DOCKWIDGET 474 #ifndef QT_NO_TOOLBAR 478 #ifndef QT_NO_DOCKWIDGET 485 #endif //QT_NO_DOCKWIDGET 490 #ifndef QT_NO_TOOLBAR 494 #ifndef QT_NO_DOCKWIDGET 497 centralWidgetRect =
QRect();
510 int i = path.
first();
512 #ifndef QT_NO_TOOLBAR 520 #ifndef QT_NO_DOCKWIDGET 523 #endif //QT_NO_DOCKWIDGET 530 int i = path.
first();
532 #ifndef QT_NO_TOOLBAR 537 #ifndef QT_NO_DOCKWIDGET 540 #endif //QT_NO_DOCKWIDGET 547 int i = path.
first();
549 #ifndef QT_NO_TOOLBAR 554 #ifndef QT_NO_DOCKWIDGET 557 #endif //QT_NO_DOCKWIDGET 564 int i = path.
first();
566 #ifndef QT_NO_TOOLBAR 571 #ifndef QT_NO_DOCKWIDGET 574 #endif //QT_NO_DOCKWIDGET 581 int i = path.
first();
590 #ifndef QT_NO_DOCKWIDGET 593 #endif //QT_NO_DOCKWIDGET 600 #ifndef QT_NO_DOCKWIDGET 603 #ifndef QT_NO_TOOLBAR 608 template <
typename T>
614 for (
int i=0; i < list.
size(); ++i) {
615 if (T t = qobject_cast<T>(list[i])) {
629 while (!stream.
atEnd()) {
634 #ifndef QT_NO_TOOLBAR 645 #endif // QT_NO_TOOLBAR 647 #ifndef QT_NO_DOCKWIDGET 672 while(!_stream.
atEnd()) {
692 while (!stream.
atEnd()) {
697 #ifndef QT_NO_DOCKWIDGET 704 for (
int i = 0; i < dockWidgets.
size(); ++i) {
721 #endif // QT_NO_DOCKWIDGET 723 #ifndef QT_NO_TOOLBAR 731 for (
int i = 0; i < toolBars.
size(); ++i) {
744 #endif //QT_NO_TOOLBAR 758 #ifndef QT_NO_TOOLBAR 801 return toToolBarArea(static_cast<QInternal::DockPosition>(pos));
808 layoutState.toolBarAreaLayout.addToolBarBreak(
toDockPos(area));
809 if (savedState.isValid())
810 savedState.toolBarAreaLayout.addToolBarBreak(
toDockPos(area));
817 layoutState.toolBarAreaLayout.insertToolBarBreak(before);
818 if (savedState.isValid())
819 savedState.toolBarAreaLayout.insertToolBarBreak(before);
825 layoutState.toolBarAreaLayout.removeToolBarBreak(before);
826 if (savedState.isValid())
827 savedState.toolBarAreaLayout.removeToolBarBreak(before);
833 layoutState.toolBarAreaLayout.moveToolBar(toolbar, pos);
834 if (savedState.isValid())
835 savedState.toolBarAreaLayout.moveToolBar(toolbar, pos);
845 toolbar,
SLOT(_q_updateIconSize(
QSize)));
850 if (usesHIToolBar(toolbar)) {
851 removeFromMacToolbar(toolbar);
855 removeWidget(toolbar);
870 && layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) {
871 insertIntoMacToolbar(0, toolbar);
876 addChildWidget(toolbar);
878 if (savedState.isValid() &&
item) {
880 savedState.toolBarAreaLayout.insertItem(
toDockPos(area), item);
885 toolbar->d_func()->updateWindowFlags(
false );
895 if (usesHIToolBar(before)) {
896 insertIntoMacToolbar(before, toolbar);
900 addChildWidget(toolbar);
901 QLayoutItem * item = layoutState.toolBarAreaLayout.insertToolBar(before, toolbar);
902 if (savedState.isValid() &&
item) {
904 savedState.toolBarAreaLayout.insertItem(before, item);
906 if (!currentGapPos.isEmpty() && currentGapPos.first() == 0) {
907 currentGapPos = layoutState.toolBarAreaLayout.currentGapIndex();
908 if (!currentGapPos.isEmpty()) {
909 currentGapPos.prepend(0);
910 currentGapRect = layoutState.itemRect(currentGapPos);
929 if (qtoolbarsInUnifiedToolbarList.contains(toolbar))
938 return layoutState.toolBarAreaLayout.toolBarBreak(toolBar);
944 layoutState.toolBarAreaLayout.getStyleOptionInfo(option, toolBar);
949 bool updateNonUnifiedParts =
true;
951 if (layoutState.mainWindow->unifiedTitleAndToolBarOnMac()) {
977 updateNonUnifiedParts = !layoutState.toolBarAreaLayout.isEmpty();
983 const int ToolBarCount = qtoolbarsInUnifiedToolbarList.size();
984 bool needAllVisible =
true;
985 for (
int i = 0; i < ToolBarCount; ++i) {
986 if (!qtoolbarsInUnifiedToolbarList.at(i)->isHidden()) {
987 needAllVisible =
false;
991 if (needAllVisible) {
994 for (
int i = 0; i < ToolBarCount; ++i)
995 qtoolbarsInUnifiedToolbarList.at(i)->setVisible(
true);
998 if (!updateNonUnifiedParts)
999 layoutState.toolBarAreaLayout.visible = goingVisible;
1002 if (updateNonUnifiedParts) {
1003 layoutState.toolBarAreaLayout.visible = !layoutState.toolBarAreaLayout.visible;
1004 if (!layoutState.mainWindow->isMaximized()) {
1007 r = layoutState.toolBarAreaLayout.rectHint(r);
1016 #endif // QT_NO_TOOLBAR 1022 #ifndef QT_NO_DOCKWIDGET 1072 if (layoutState.dockAreaLayout.corners[corner] == area)
1074 layoutState.dockAreaLayout.corners[corner] =
area;
1075 if (savedState.isValid())
1076 savedState.dockAreaLayout.corners[corner] = area;
1082 return layoutState.dockAreaLayout.corners[corner];
1089 addChildWidget(dockwidget);
1093 if (!movingSeparator.isEmpty())
1094 endSeparatorMove(movingSeparatorPos);
1096 layoutState.dockAreaLayout.addDockWidget(
toDockPos(area), dockwidget, orientation);
1103 addChildWidget(second);
1104 layoutState.dockAreaLayout.tabifyDockWidget(first, second);
1111 addChildWidget(dockwidget);
1112 if (!layoutState.dockAreaLayout.restoreDockWidget(dockwidget))
1119 #ifndef QT_NO_TABBAR 1122 return _documentMode;
1127 if (_documentMode == enabled)
1133 foreach (
QTabBar *bar, usedTabBars)
1135 foreach (
QTabBar *bar, unusedTabBars)
1138 #endif // QT_NO_TABBAR 1145 if (verticalTabsEnabled == enabled)
1148 verticalTabsEnabled =
enabled;
1150 updateTabBarShapes();
1151 #endif // QT_NO_TABBAR 1154 #ifndef QT_NO_TABWIDGET 1162 if (_tabShape == tabShape)
1165 _tabShape = tabShape;
1167 updateTabBarShapes();
1191 if (areas & dockWidgetAreas[i])
1192 tabPositions[dockPositions[i]] = tabPosition;
1194 updateTabBarShapes();
1210 #endif // QT_NO_TABWIDGET 1212 #ifndef QT_NO_TABBAR 1215 #ifndef QT_NO_TABWIDGET 1234 #ifndef QT_NO_TABWIDGET 1243 #endif // QT_NO_TABBAR 1249 addChildWidget(dockwidget);
1250 layoutState.dockAreaLayout.splitDockWidget(after, dockwidget, orientation);
1265 layoutState.dockAreaLayout.keepSize(w);
1268 #ifndef QT_NO_TABBAR 1305 if (!unusedTabBars.isEmpty()) {
1306 result = unusedTabBars.takeLast();
1315 usedTabBars.insert(result);
1323 if (!unusedSeparatorWidgets.isEmpty()) {
1324 result = unusedSeparatorWidgets.takeLast();
1331 usedSeparatorWidgets.insert(result);
1345 if (
QWidget *w = centralWidget())
1348 #endif // QT_NO_TABBAR 1352 movingSeparator = layoutState.dockAreaLayout.findSeparator(pos);
1354 if (movingSeparator.isEmpty())
1357 savedState = layoutState;
1358 movingSeparatorPos = movingSeparatorOrigin =
pos;
1365 if (movingSeparator.isEmpty())
1367 movingSeparatorPos =
pos;
1368 separatorMoveTimer.start(0,
this);
1374 if (movingSeparator.isEmpty())
1376 movingSeparator.clear();
1386 #ifndef QT_NO_TABBAR 1393 #endif // QT_NO_DOCKWIDGET 1402 qWarning(
"QMainWindowLayout::count: ?");
1410 if (
QLayoutItem *ret = layoutState.itemAt(index, &x))
1413 if (statusbar && x++ == index)
1423 if (
QLayoutItem *ret = layoutState.takeAt(index, &x)) {
1425 if (
QWidget *w = ret->widget()) {
1426 widgetAnimator.abort(w);
1427 if (w == pluggingWidget)
1431 if (savedState.isValid() ) {
1433 savedState.remove(ret);
1435 layoutState.remove(ret);
1438 #ifndef QT_NO_TOOLBAR 1439 if (!currentGapPos.isEmpty() && currentGapPos.first() == 0) {
1440 currentGapPos = layoutState.toolBarAreaLayout.currentGapIndex();
1441 if (!currentGapPos.isEmpty()) {
1442 currentGapPos.prepend(0);
1443 currentGapRect = layoutState.itemRect(currentGapPos);
1451 if (statusbar && x++ == index) {
1462 if (savedState.isValid())
1475 statusbar->setGeometry(vr);
1479 layoutState.rect = r;
1480 layoutState.fitLayout();
1481 applyState(layoutState,
false);
1485 {
qWarning(
"QMainWindowLayout::addItem: Please use the public QMainWindow API instead"); }
1489 if (!szHint.isValid()) {
1490 szHint = layoutState.sizeHint();
1491 const QSize sbHint = statusbar ? statusbar->sizeHint() :
QSize(0, 0);
1493 sbHint.
height() + szHint.height());
1500 if (!minSize.isValid()) {
1501 minSize = layoutState.minimumSize();
1502 const QSize sbMin = statusbar ? statusbar->minimumSize() :
QSize(0, 0);
1504 sbMin.
height() + minSize.height());
1506 const QSize storedSize = minSize;
1511 minSize =
QSize(
qMax(minWidth, storedSize.width()), storedSize.height());
1520 minSize = szHint =
QSize();
1529 #ifndef QT_NO_TOOLBAR 1546 if (toolBar->
size() != hint) {
1561 if (!savedState.isValid())
1565 layoutState = savedState;
1566 currentGapPos = layoutState.indexOf(widget);
1568 layoutState.unplug(currentGapPos);
1569 layoutState.fitLayout();
1570 currentGapRect = layoutState.itemRect(currentGapPos);
1591 layoutState.remove(previousPath);
1594 QRect globalRect = currentGapRect;
1596 #ifndef QT_NO_DOCKWIDGET 1597 if (qobject_cast<QDockWidget*>(widget) != 0) {
1603 globalRect.
adjust(-fw, -fw, fw, fw);
1616 #ifndef QT_NO_TOOLBAR 1617 if (
QToolBar *tb = qobject_cast<QToolBar*>(widget)) {
1628 if (widget == pluggingWidget) {
1630 #ifndef QT_NO_DOCKWIDGET 1631 if (
QDockWidget *dw = qobject_cast<QDockWidget*>(widget))
1632 dw->d_func()->plug(currentGapRect);
1634 #ifndef QT_NO_TOOLBAR 1635 if (
QToolBar *tb = qobject_cast<QToolBar*>(widget))
1636 tb->d_func()->plug(currentGapRect);
1640 currentGapPos.clear();
1644 layoutState.apply(
false);
1646 #ifndef QT_NO_DOCKWIDGET 1647 #ifndef QT_NO_TABBAR 1648 if (qobject_cast<QDockWidget*>(widget) != 0) {
1652 info->setCurrentTab(widget);
1658 if (!widgetAnimator.animating()) {
1660 #ifndef QT_NO_DOCKWIDGET 1662 #ifndef QT_NO_TABBAR 1663 foreach (
QTabBar *tab_bar, usedTabBars)
1665 #endif // QT_NO_TABBAR 1666 #endif // QT_NO_DOCKWIDGET 1669 updateGapIndicator();
1674 if (!savedState.isValid())
1677 layoutState = savedState;
1678 applyState(layoutState);
1679 if (!keepSavedState)
1681 currentGapPos.clear();
1683 updateGapIndicator();
1688 , layoutState(mainwindow)
1689 , savedState(mainwindow)
1694 , _documentMode(false)
1695 , verticalTabsEnabled(false)
1701 , widgetAnimator(this)
1707 , activateUnifiedToolbarAfterFullScreen(false)
1708 , blockVisiblityCheck(false)
1714 #ifndef QT_NO_DOCKWIDGET 1715 #ifndef QT_NO_TABBAR 1719 #ifndef QT_NO_TABWIDGET 1723 #endif // QT_NO_DOCKWIDGET 1725 #ifndef QT_NO_RUBBERBAND 1754 #ifndef QT_NO_DOCKWIDGET 1761 #ifndef QT_NO_STATUSBAR 1773 #endif // QT_NO_STATUSBAR 1786 #ifndef QT_NO_DOCKWIDGET 1809 #ifndef QT_NO_DOCKWIDGET 1810 if (
QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
1814 #ifndef QT_NO_TOOLBAR 1815 if (
QToolBar *tb = qobject_cast<QToolBar*>(widget)) {
1816 tb->d_func()->unplug(r);
1834 #ifndef QT_NO_RUBBERBAND 1855 bool allowed =
false;
1857 #ifndef QT_NO_DOCKWIDGET 1858 if (
QDockWidget *dw = qobject_cast<QDockWidget*>(widget))
1861 #ifndef QT_NO_TOOLBAR 1862 if (
QToolBar *tb = qobject_cast<QToolBar*>(widget))
1884 if (!newState.insertGap(path, widgetItem)) {
1889 QSize min = newState.minimumSize();
1892 if (min.width() > size.
width() || min.height() > size.
height()) {
1897 newState.fitLayout();
1901 #ifndef QT_NO_DOCKWIDGET 1914 #ifndef QT_NO_DOCKWIDGET 1915 #ifndef QT_NO_TABBAR 1919 foreach (
QTabBar *tab_bar, retired) {
1921 while (tab_bar->
count() > 0)
1930 foreach (
QWidget *sepWidget, retiredSeps) {
1936 #endif // QT_NO_TABBAR 1937 #endif // QT_NO_DOCKWIDGET 1968 #ifndef QT_NO_DOCKWIDGET 1970 #ifndef QT_NO_TABBAR 1976 #endif // QT_NO_DOCKWIDGET 1999 #ifndef QT_NO_DOCKWIDGET 2023 #endif // QT_NO_MAINWINDOW void setDrawBase(bool drawTheBase)
QMainWindowLayoutState(QMainWindow *win)
bool documentMode() const
QSet< QTabBar * > usedTabBars() const
Qt::ToolBarArea toolBarArea(QToolBar *toolbar) const
QSet< QTabBar * > usedTabBars
QList< QDockAreaLayoutItem > item_list
void deleteAllLayoutItems()
void setBottom(int pos)
Sets the bottom edge of the rectangle to the given y coordinate.
bool event(QEvent *)
em>Reimplemented Function
static mach_timebase_info_data_t info
void currentChanged(int index)
This signal is emitted when the tab bar's current tab changes.
#define QT_END_NAMESPACE
This macro expands to.
void addToolBarBreak(Qt::ToolBarArea area)
QPointer< QWidget > widget
char * data()
Returns a pointer to the data stored in the byte array.
QWidget * getSeparatorWidget()
void revert(QLayoutItem *widgetItem)
void setGeometry(const QRect &r)
Reimplemented Function
QLayoutItem * itemAt(int index, int *x) const
void remove(const QList< int > &path)
QLayoutItem * plug(const QList< int > &path)
#define it(className, varName)
void saveState(QDataStream &stream) const
QRect itemRect(const QList< int > &path) const
void setTabPosition(Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition)
QList< int > currentGapPos
QTabWidget::TabShape tabShape() const
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
void setStatusBar(QStatusBar *sb)
static QList< T > findChildrenHelper(const QObject *o)
void keepSize(QDockWidget *w)
bool checkFormat(QDataStream &stream, bool pre43)
bool atEnd() const
Returns true if the I/O device has reached the end position (end of the stream or file) or if there i...
The QByteArray class provides an array of bytes.
void setDockOptions(QMainWindow::DockOptions opts)
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
static QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position)
QList< int > gapIndex(QWidget *widget, const QPoint &pos) const
void moveRight(int pos)
Moves the rectangle horizontally, leaving the rectangle's right edge at the given x coordinate...
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
int left() const
Returns the x-coordinate of the rectangle's left edge.
int width() const
Returns the width of the rectangle.
void deleteCentralWidgetItem()
QMainWindowLayoutState layoutState
void timerEvent(QTimerEvent *e)
This event handler can be reimplemented in a subclass to receive timer events for the object...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
void updateTabBarShapes()
static void validateToolBarArea(Qt::ToolBarArea &area)
virtual void setGeometry(const QRect &)
Reimplemented Function
QTabWidget::TabPosition tabPosition(Qt::DockWidgetArea area) const
void setCentralWidget(QWidget *cw)
int count(const T &t) const
Returns the number of occurrences of value in the list.
void raise(QDockWidget *widget)
void moveTo(int x, int t)
Moves the rectangle, leaving the top-left corner at the given position (x, y).
The QTabBar class provides a tab bar, e.g.
QPlaceHolderItem * placeHolderItem
QList< int > hover(QLayoutItem *widgetItem, const QPoint &mousePos)
void invalidate()
Reimplemented Function
int height() const
Returns the height of the rectangle.
int bottom() const
Returns the y-coordinate of the rectangle's bottom edge.
void addDockWidget(Qt::DockWidgetArea area, QDockWidget *dockwidget, Qt::Orientation orientation)
The QString class provides a Unicode character string.
T * qobject_cast(QObject *object)
void saveState(QDataStream &stream) const
int count() const
Must be implemented in subclasses to return the number of items in the layout.
The QObject class is the base class of all Qt objects.
QSize sizeHint() const
em>Reimplemented Function
void removeTab(int index)
Removes the tab at position index.
void moveBottom(int pos)
Moves the rectangle vertically, leaving the rectangle's bottom edge at the given y coordinate...
QSize boundedTo(const QSize &) const
Returns a size holding the minimum width and height of this size and the given otherSize.
bool macWindowToolbarIsVisible(void *window)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
void apply(bool animated)
QDockAreaLayout dockAreaLayout
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
void setParent(QObject *)
Makes the object a child of parent.
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
QList< T > mid(int pos, int length=-1) const
Returns a list whose elements are copied from this list, starting at position pos.
OSWindowRef qt_mac_window_for(const QWidget *)
void setObjectName(const QString &name)
void setCentralWidget(QWidget *widget)
The QStatusBar class provides a horizontal bar suitable for presenting status information.
void getStyleOptionInfo(QStyleOptionToolBar *option, QToolBar *toolBar) const
QRect gapRect(const QList< int > &path) const
QSet< QWidget * > usedSeparatorWidgets() const
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
QLayoutItem * centralWidgetItem
void invalidate()
Reimplemented Function
QMainWindow::DockOptions dockOptions
void setCorner(Qt::Corner corner, Qt::DockWidgetArea area)
int width() const
Returns the width.
void addToolBar(Qt::ToolBarArea area, QToolBar *toolbar, bool needAddChildWidget=true)
Adds toolbar to area, continuing the current line.
void append(const T &t)
Inserts value at the end of the list.
QLayoutItem * takeAt(int index, int *x)
static void validateDockWidgetArea(Qt::DockWidgetArea &area)
#define QT_BEGIN_NAMESPACE
This macro expands to.
QRect gapRect(const QList< int > &path) const
void setGeometry(const QRect &r)
Sets the geometry of the rubber band to rect, specified in the coordinate system of its parent widget...
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Shape
This enum type lists the built-in shapes supported by QTabBar.
void setVerticalTabsEnabled(bool enabled)
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
QLayoutItem * takeAt(int *x, int index)
QWidget * centralWidget() const
int readRawData(char *, int len)
Reads at most len bytes from the stream into s and returns the number of bytes read.
void setCurrentTab(QWidget *widget)
QSize minimumSize() const
static void fixToolBarOrientation(QLayoutItem *item, int dockPos)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
The Rectangle item provides a filled rectangle with an optional border.
void setExpanding(bool enabled)
void removeToolBar(QToolBar *toolbar)
The QLayout class is the base class of geometry managers.
bool toolBarBreak(QToolBar *toolBar) const
void prepend(const T &t)
Inserts value at the beginning of the list.
const T & at(int i) const
Returns the item at index position i in the list.
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
void setDocumentMode(bool set)
QRubberBand * gapIndicator
void setElideMode(Qt::TextElideMode)
QDockAreaLayoutInfo * info(const QList< int > &path)
Q_CORE_EXPORT void qWarning(const char *,...)
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
void transpose()
Swaps the width and height values.
void setTabBarShape(int shape)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
QRegion separatorRegion() const
void restore(bool keepSavedState=false)
QLayoutItem * itemAt(int *x, int index) const
void clear()
Removes all items from the list.
void insertToolBarBreak(QToolBar *before)
QList< int > indexOf(QWidget *dockWidget) const
QSet< QWidget * > usedSeparatorWidgets
bool restoreState(QDataStream &stream, const QMainWindowLayoutState &oldState)
bool insertGap(const QList< int > &path, QLayoutItem *item)
void moveTopLeft(const QPoint &p)
Moves the rectangle, leaving the top-left corner at the given position.
static QWidget * parentWidget(const QWidget *w)
void stop()
Stops the timer.
static Qt::ToolBarArea toToolBarArea(QInternal::DockPosition pos)
void moveToolBar(QToolBar *toolbar, int pos)
T & first()
Returns a reference to the first item in the list.
void addItem(QLayoutItem *item)
Implemented in subclasses to add an item.
static QInternal::DockPosition toDockPos(Qt::ToolBarArea area)
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
bool unifiedTitleAndToolBarOnMac
whether the window uses the unified title and toolbar look on Mac OS X
QTabWidget::TabPosition tabPositions[4]
QLayoutItem * unplug(const QList< int > &path)
bool insertGap(const QList< int > &path, QLayoutItem *dockWidgetItem)
QPoint movingSeparatorOrigin
QDockAreaLayoutInfo docks[4]
int top() const
Returns the y-coordinate of the rectangle's top edge.
void updateGapIndicator()
static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect)
Returns the given logicalRectangle converted to screen coordinates based on the specified direction...
Qt::DockWidgetArea corner(Qt::Corner corner) const
int right() const
Returns the x-coordinate of the rectangle's right edge.
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
bool restoreState(QDataStream &stream, const QList< QDockWidget *> &widgets, bool testing=false)
int count
the number of tabs in the tab bar
The QTimerEvent class contains parameters that describe a timer event.
QLayoutItem * item(const QList< int > &path)
The QTextStream class provides a convenient interface for reading and writing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
void insertToolBar(QToolBar *before, QToolBar *toolbar)
Adds toolbar before before.
QMainWindowLayout(QMainWindow *mainwindow, QLayout *parentLayout)
bool plug(QLayoutItem *widgetItem)
int separatorMove(const QList< int > &separator, const QPoint &origin, const QPoint &dest)
bool event(QEvent *e)
This is the main event handler; it handles event event.
Qt::DockWidgetArea dockWidgetArea(QDockWidget *dockwidget) const
int x() const
Returns the x-coordinate of the rectangle's left edge.
QList< QWidget * > unusedSeparatorWidgets
bool contains(QWidget *widget) const
The QPoint class defines a point in the plane using integer precision.
void resize(int size)
Sets the size of the byte array to size bytes.
QDockAreaLayoutInfo * subinfo
The QMainWindow class provides a main application window.
void toggleToolBarsVisible()
int size() const
Returns the number of items in the list.
QDockAreaLayoutItem & item(const QList< int > &path)
QLayoutItem * itemAt(int index) const
Must be implemented in subclasses to return the layout item at index.
QList< int > indexOf(QWidget *widget) const
void splitDockWidget(QDockWidget *after, QDockWidget *dockwidget, Qt::Orientation orientation)
QString objectName() const
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
int timerId() const
Returns the timer's ID.
QSize minimumSize() const
QWidget * centralWidget() const
const QObjectList & children() const
Returns a list of child objects.
QStatusBar * statusBar() const
int size() const
Returns the number of bytes in this byte array.
void applyState(QMainWindowLayoutState &newState, bool animate=true)
QList< QTabBar * > unusedTabBars
QBasicTimer separatorMoveTimer
QList< int > gapIndex(const QPoint &pos) const
void flush()
Flushes any buffered data waiting to be written to the device.
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
QWidgetAnimator widgetAnimator
QMainWindowTabBar(QWidget *parent)
void removeToolBarBreak(QToolBar *before)
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
QSize minimumSize() const
Returns the minimum size of this layout.
The QSize class defines the size of a two-dimensional object using integer point precision.
The QDataStream class provides serialization of binary data to a QIODevice.
static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos)
void saveState(QDataStream &stream) const
void setTabShape(QTabWidget::TabShape tabShape)
void setDocumentMode(bool enabled)
void cleanUpMacToolbarItems()
QPoint movingSeparatorPos
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
QLayoutItem * plug(const QList< int > &path)
QLayoutItem * takeAt(int index)
Must be implemented in subclasses to remove the layout item at index from the layout, and return the item.
void remove(const QList< int > &path)
QRect itemRect(const QList< int > &path) const
QToolBarAreaLayout toolBarAreaLayout
The QEvent class is the base class of all event classes.
The QRubberBand class provides a rectangle or line that can indicate a selection or a boundary...
Type type() const
Returns the event type.
void deleteAllLayoutItems()
void animationFinished(QWidget *widget)
QSize sizeHint() const
Implemented in subclasses to return the preferred size of this item.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QMainWindowLayoutState savedState
QLayoutItem * unplug(const QList< int > &path, QMainWindowLayoutState *savedState=0)
bool restoreState(QDataStream &stream)
bool startSeparatorMove(const QPoint &pos)
bool separatorMove(const QPoint &pos)
bool usesHIToolBar(QToolBar *toolbar) const
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
void tabifyDockWidget(QDockWidget *first, QDockWidget *second)
bool restoreDockWidget(QDockWidget *dockwidget)
QList< int > movingSeparator
static int area(const QSize &s)
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
QLayoutItem * unplug(QWidget *widget)
bool endSeparatorMove(const QPoint &pos)