5#include "QtWidgets/qapplication.h"
6#include "QtWidgets/qwidget.h"
8#include "QtWidgets/qtabbar.h"
10#include "QtWidgets/qstyle.h"
11#include "QtWidgets/qapplication.h"
12#include "QtCore/qvariant.h"
20#include <private/qlayoutengine_p.h>
70 if (
other.subinfo !=
nullptr)
72 else if (
other.placeHolderItem !=
nullptr)
145 return QSize(-1, -1);
156 if (
other.subinfo ==
nullptr)
162 if (
other.placeHolderItem ==
nullptr)
174#ifndef QT_NO_DEBUG_STREAM
179 dbg <<
"QDockAreaLayoutItem(" <<
static_cast<const void *
>(&
item) <<
"->";
181 dbg <<
"widgetItem(" <<
item.widgetItem->widget() <<
")";
182 else if (
item.subinfo)
183 dbg <<
"subInfo(" <<
item.subinfo <<
")";
184 else if (
item.placeHolderItem)
185 dbg <<
"placeHolderItem(" <<
item.placeHolderItem <<
")";
198 if (
item.widgetItem ==
nullptr)
200 return reinterpret_cast<quintptr>(
item.widgetItem->widget());
217 :
sep(_sep), dockPos(_dockPos),
o(_o), mainWindow(
window)
222#if !QT_CONFIG(tabbar)
244 return next(-1) == -1;
250 if (!
item.placeHolderItem)
290 QSize tbm = tabBarMinimumSize();
292 switch (tabBarShape) {
363 QSize tbh = tabBarSizeHint();
365 switch (tabBarShape) {
420 max_perp =
qMax(max_perp, min_perp);
430 QSize tbh = tabBarSizeHint();
431 switch (tabBarShape) {
547 if (previous && !gap) {
560 if (
size < min_size) {
563 min_size -=
item.size;
565 min_size =
qMax(0, min_size);
566 }
else if (
size > max_size) {
569 max_size -=
item.size;
598 if (
size > max_size && last_index != -1) {
600 layout_struct_list[last_index].expansive =
true;
606 bool prev_gap =
false;
614 if (!
first && !gap && !prev_gap)
621 if (
item.subinfo !=
nullptr) {
623 item.subinfo->fitItems();
643 int w =
rect.width();
644 int h =
rect.height();
648 if (nestingEnabled) {
659 if (center.contains(
pos))
671 if (
x >
w/6 &&
x <
w*5/6)
681 if (
y >
h/6 &&
y < 5*
h/6)
687 if (nestingEnabled) {
734 bool nestingEnabled,
TabMode tabMode)
const
742 item_rect = tabContentRect();
759 if (
item.subinfo !=
nullptr
761 && !
item.subinfo->tabbed
764 result =
item.subinfo->gapIndex(_pos, nestingEnabled,
791 result << item_index << 0;
798 result << item_index << 1;
802 result << item_index << 0;
808 result << item_index << 1;
813 result << (-item_index - 1) << 0;
828 int old_size = ls.
size;
830 return old_size - ls.
size;
837 int old_size = ls.
size;
839 return ls.
size - old_size;
868 if (delta > growlimit)
876 for (
int i =
index; d < delta && i >= 0; --
i)
878 }
else if (delta < 0) {
890 if (-delta > growlimit)
894 for (
int i =
index;
d < -delta &&
i >= 0; --
i)
934 const int separatorSpace =
item.hasFixedSize(
o) ? 0 : *
sep;
937 ls.
size =
item.size + separatorSpace;
952 const int separatorSpace =
item.hasFixedSize(
o) ? 0 : *
sep;
953 item.size = ls.
size - separatorSpace;
955 if (
item.subinfo !=
nullptr) {
957 item.subinfo->fitItems();
967 if (
item.subinfo ==
nullptr)
969 if (
item.subinfo->item_list.size() > 1)
972 if (
item.subinfo->item_list.size() == 0) {
974 }
else if (
item.subinfo->item_list.size() == 1) {
976 if (
child.widgetItem !=
nullptr) {
979 item.subinfo =
nullptr;
980 }
else if (
child.subinfo !=
nullptr) {
983 child.subinfo =
nullptr;
994 if (
path.size() > 1) {
1014 if (
path.size() > 1) {
1017 return item.subinfo->plug(
path.mid(1));
1025 return item.widgetItem;
1033 if (
path.size() > 1) {
1036 return item.subinfo->unplug(
path.mid(1));
1046#if QT_CONFIG(tabbar)
1059 return item.widgetItem;
1062#if QT_CONFIG(tabbar)
1064quintptr QDockAreaLayoutInfo::currentTabId()
const
1066 if (!tabbed || tabBar ==
nullptr)
1069 int index = tabBar->currentIndex();
1073 return qvariant_cast<quintptr>(tabBar->tabData(
index));
1081void QDockAreaLayoutInfo::setCurrentTabId(
quintptr id)
1083 if (!tabbed || tabBar ==
nullptr)
1086 for (
int i = 0;
i < tabBar->count(); ++
i) {
1087 if (qvariant_cast<quintptr>(tabBar->tabData(
i)) ==
id) {
1088 tabBar->setCurrentIndex(
i);
1098 int titleHeight = 0;
1103 titleHeight =
layout->titleHeight();
1129 bool insert_tabbed =
false;
1132 insert_tabbed =
true;
1138 if (
path.size() > 1) {
1141 if (
item.subinfo ==
nullptr
1143 || (
item.subinfo->tabbed && !insert_tabbed)
1155#if !QT_CONFIG(tabbar)
1156 const int tabBarShape = 0;
1162 item.subinfo = new_info;
1163 item.widgetItem =
nullptr;
1164 item.placeHolderItem =
nullptr;
1167 = widgetItem ==
nullptr
1170 new_item.
size =
pick(opposite,
r.size());
1171 new_item.
pos =
pick(opposite,
r.topLeft());
1173#if QT_CONFIG(tabbar)
1174 if (insert_tabbed) {
1175 new_info->tabbed =
true;
1180 return item.subinfo->insertGap(
path.mid(1), dockWidgetItem);
1188#if QT_CONFIG(tabbar)
1225 "QDockAreaLayoutInfo::insertGap",
"inserting two gaps after each other");
1239 gap_size =
pick(
o,
r.size());
1245 if (gap_size + sep_size > space)
1247 gap_item.
size = gap_size + sep_size;
1252 qCDebug(lcQpaDockWidgets) <<
"Insert gap after:" <<
index <<
this;
1264#if QT_CONFIG(tabbar)
1265 if (tabbed &&
widget == tabBar)
1269 if (
item.widgetItem !=
nullptr &&
item.widgetItem->widget() ==
widget)
1272 if (
item.subinfo !=
nullptr) {
1305#if QT_CONFIG(tabbar)
1307 if (isGap || tabId(
item) == currentTabId())
1308 result = tabContentRect();
1343 if (
path.size() > 1) {
1346 return item.subinfo->itemRect(
path.mid(1));
1354#if QT_CONFIG(tabbar)
1376 if (
path.size() > 1) {
1379 return item.subinfo->separatorRect(
path.mid(1));
1386#if QT_CONFIG(tabbar)
1399 if (
item.subinfo !=
nullptr) {
1416 sepRect.
adjust(-2, -2, 2, 2);
1432 if (
item.subinfo !=
nullptr) {
1441 if (
item.placeHolderItem !=
nullptr &&
item.placeHolderItem->objectName == objectName) {
1456 if (
item.placeHolderItem !=
nullptr)
1459 if (
item.subinfo !=
nullptr) {
1497#if QT_CONFIG(tabbar)
1500 QSize tbh = tabBarSizeHint();
1503 switch (tabBarShape) {
1528 widgetAnimator.
animate(tabBar, tab_rect, animate);
1540 if (
item.subinfo !=
nullptr) {
1541 item.subinfo->apply(animate);
1552 QRect geo =
w->geometry();
1554 if (!
w->isHidden() &&
w->window()->isVisible()) {
1556 if (!
r.isValid() && geo.
right() >= 0 && geo.
bottom() >= 0) {
1559 }
else if (
r.isValid()
1566#if QT_CONFIG(tabbar)
1568 updateSeparatorWidgets();
1596#if QT_CONFIG(tabbar)
1622 const QPoint &mouse)
const
1626#if QT_CONFIG(tabbar)
1644 item.subinfo->paintSeparators(
p,
widget, clip, mouse);
1666 for (
int i =
index - 1;
i >= 0; --
i) {
1673#if QT_CONFIG(tabbar)
1679 setCurrentTab(dockWidgetItem->
widget());
1687 new_info->tabbed =
true;
1688 new_info->updateTabBar();
1689 new_info->setCurrentTab(dockWidgetItem->
widget());
1697 if (orientation ==
o) {
1700#if !QT_CONFIG(tabbar)
1701 const int tabBarShape = 0;
1716 if (
path.size() > 1) {
1719 return item.subinfo->item(
path.mid(1));
1728 if (
item.placeHolderItem !=
nullptr)
1733 }
else if (
item.widgetItem) {
1735 return item.widgetItem;
1745 if (
item.placeHolderItem !=
nullptr)
1747 else if (
item.subinfo) {
1752 }
else if (
item.widgetItem) {
1756 item.widgetItem =
nullptr;
1757 if (
item.size != -1)
1771 item.subinfo->deleteAllLayoutItems();
1773 delete item.widgetItem;
1774 item.widgetItem =
nullptr;
1781#if QT_CONFIG(tabbar)
1805 if (
item.widgetItem !=
nullptr) {
1810 qWarning(
"QMainWindow::saveState(): 'objectName' not set for QDockWidget %p '%ls;",
1822 if (
w->isWindow()) {
1823 const QRect geometry =
w->geometry();
1829 }
else if (
item.placeHolderItem !=
nullptr) {
1833 if (!
item.placeHolderItem->hidden)
1839 QRect r =
item.placeHolderItem->topLevelRect;
1840 stream <<
r.
x() <<
r.y() <<
r.width() <<
r.height();
1844 }
else if (
item.subinfo !=
nullptr) {
1870#if QT_CONFIG(tabbar)
1885 for (
int i = 0;
i < cnt; ++
i) {
1892 if (
name.isEmpty()) {
1894 stream >> dummy >> dummy >> dummy >> dummy;
1913 if (placeHolder->
window) {
1921 if (
item.size != -1)
1928 bool drawer =
false;
1933 widget->setFloating(
true);
1951 widget->setFloating(
false);
1958 delete item.widgetItem;
1963#if !QT_CONFIG(tabbar)
1964 const int tabBarShape = 0;
1984#if QT_CONFIG(tabbar)
1989 if (!testing && *
sep == 1)
1990 updateSeparatorWidgets();
1996#if QT_CONFIG(tabbar)
1997void QDockAreaLayoutInfo::updateSeparatorWidgets()
const
2017 item.subinfo->updateSeparatorWidgets();
2027 qWarning(
"QDockAreaLayoutInfo::updateSeparatorWidgets: null separator widget");
2060 tabBar->setParent(
parent);
2068 if (
item.widgetItem) {
2070 if (qobject_cast<QDockWidgetGroupWindow *>(
w))
2073 bool hidden =
w->isHidden();
2074 w->setParent(
parent,
w->windowFlags());
2083bool QDockAreaLayoutInfo::updateTabBar()
const
2090 if (that->tabBar ==
nullptr) {
2092 that->tabBar->setShape(
static_cast<QTabBar::Shape>(tabBarShape));
2093 that->tabBar->setDrawBase(
true);
2099 const quintptr oldCurrentId = currentTabId();
2110 if (
item.widgetItem ==
nullptr)
2113 QDockWidget *dw = qobject_cast<QDockWidget*>(
item.widgetItem->widget());
2116 if (tab_idx == tabBar->count()) {
2117 tabBar->insertTab(tab_idx,
title);
2118#if QT_CONFIG(tooltip)
2119 tabBar->setTabToolTip(tab_idx,
title);
2121 tabBar->setTabData(tab_idx,
id);
2122 }
else if (qvariant_cast<quintptr>(tabBar->tabData(tab_idx)) !=
id) {
2123 if (tab_idx + 1 < tabBar->count()
2124 && qvariant_cast<quintptr>(tabBar->tabData(tab_idx + 1)) ==
id)
2125 tabBar->removeTab(tab_idx);
2127 tabBar->insertTab(tab_idx,
title);
2128#if QT_CONFIG(tooltip)
2129 tabBar->setTabToolTip(tab_idx,
title);
2131 tabBar->setTabData(tab_idx,
id);
2135 if (
title != tabBar->tabText(tab_idx)) {
2136 tabBar->setTabText(tab_idx,
title);
2137#if QT_CONFIG(tooltip)
2138 tabBar->setTabToolTip(tab_idx,
title);
2145 while (tab_idx < tabBar->
count()) {
2146 tabBar->removeTab(tab_idx);
2149 if (oldCurrentId > 0 && currentTabId() != oldCurrentId)
2150 that->setCurrentTabId(oldCurrentId);
2152 if (QDockWidgetGroupWindow *dwgw = qobject_cast<QDockWidgetGroupWindow *>(tabBar->parent()))
2153 dwgw->adjustFlags();
2156 return ( (gap ? 1 : 0) + tabBar->
count()) > 1;
2159void QDockAreaLayoutInfo::setTabBarShape(
int shape)
2161 if (shape == tabBarShape)
2163 tabBarShape = shape;
2164 if (tabBar !=
nullptr)
2169 if (
item.subinfo !=
nullptr)
2170 item.subinfo->setTabBarShape(shape);
2174QSize QDockAreaLayoutInfo::tabBarMinimumSize()
const
2176 if (!updateTabBar())
2179 return tabBar->minimumSizeHint();
2182QSize QDockAreaLayoutInfo::tabBarSizeHint()
const
2184 if (!updateTabBar())
2187 return tabBar->sizeHint();
2201 if (
item.subinfo !=
nullptr)
2214 result.reserve(numSeparatorWidgets);
2216 for (
int i = 0;
i < numSeparatorWidgets; ++
i)
2221 if (
item.subinfo !=
nullptr)
2222 result +=
item.subinfo->usedSeparatorWidgets();
2228QRect QDockAreaLayoutInfo::tabContentRect()
const
2234 QSize tbh = tabBarSizeHint();
2237 switch (tabBarShape) {
2262int QDockAreaLayoutInfo::tabIndexToListIndex(
int tabIndex)
const
2265 quintptr data = qvariant_cast<quintptr>(tabBar->tabData(tabIndex));
2273void QDockAreaLayoutInfo::moveTab(
int from,
int to)
2275 item_list.
move(tabIndexToListIndex(from), tabIndexToListIndex(to));
2287#if QT_CONFIG(tabbar)
2290 const int tabShape = 0;
2332 for (
int i = 0;
i < 4; ++
i)
2342 for (
int i = 0;
i < cnt; ++
i) {
2364 for (
int i = 0;
i < 4; ++
i)
2367 for (
int i = 0;
i < 4; ++
i)
2407#if QT_CONFIG(tabbar)
2408 if (!disallowTabs) {
2415 nestingEnabled =
false;
2435 if (
info.isEmpty()) {
2437 if (
r.contains(
pos)) {
2454 Q_ASSERT_X(
mainWindow,
"QDockAreaLayout::gapRect",
"Called without valid mainWindow pointer.");
2463 "QDockAreaLayout::gapRect: Main window height %i is too small. Docking will not be possible.",
2469 "QDockAreaLayout::gapRect: Main window width %i is too small. Docking will not be possible.",
2502 }
else if (
info.rect.contains(
pos)) {
2530 if (
path.size() == 1)
2565 return QRect(
r.right() + 1,
r.top(),
sep,
r.height());
2569 return QRect(
r.left(),
r.bottom() + 1,
r.width(),
sep);
2585 if (
path.size() == 1)
2601#if QT_CONFIG(tabbar)
2632 if (!
index.isEmpty())
2636 for (QDockWidgetGroupWindow *dwgw :
groups) {
2637 index = dwgw->layoutInfo()->indexOfPlaceHolder(
name);
2638 if (!
index.isEmpty()) {
2639 dwgw->layoutInfo()->remove(
index);
2640 dwgw->destroyOrHideIfEmpty();
2645static inline int qMax(
int i1,
int i2,
int i3) {
return qMax(i1,
qMax(i2, i3)); }
2650 QSize center_hint(0, 0);
2651 QSize center_min(0, 0);
2652 QSize center_max(0, 0);
2700 if (_ver_struct_list !=
nullptr) {
2702 ver_struct_list.
resize(3);
2705 ver_struct_list[0].init();
2706 ver_struct_list[0].stretch = 0;
2707 ver_struct_list[0].sizeHint = top_hint.
height();
2708 ver_struct_list[0].minimumSize = top_min.
height();
2709 ver_struct_list[0].maximumSize = top_max.
height();
2710 ver_struct_list[0].expansive =
false;
2716 ver_struct_list[1].init();
2717 ver_struct_list[1].stretch = center_hint.
height();
2728 int left = (tl_significant && bl_significant) ? left_hint.
height() : 0;
2729 int right = (tr_significant && br_significant) ? right_hint.
height() : 0;
2732 left = (tl_significant && bl_significant) ? left_min.
height() : 0;
2733 right = (tr_significant && br_significant) ? right_min.
height() : 0;
2735 ver_struct_list[1].maximumSize = center_max.
height();
2736 ver_struct_list[1].expansive = have_central;
2740 ver_struct_list[1].pos = center_rect.
top();
2741 ver_struct_list[1].
size = center_rect.
height();
2744 ver_struct_list[2].init();
2745 ver_struct_list[2].stretch = 0;
2746 ver_struct_list[2].sizeHint = bottom_hint.
height();
2747 ver_struct_list[2].minimumSize = bottom_min.
height();
2748 ver_struct_list[2].maximumSize = bottom_max.
height();
2749 ver_struct_list[2].expansive =
false;
2754 for (
int i = 0;
i < 3; ++
i) {
2755 ver_struct_list[
i].sizeHint
2758 if (have_central && ver_struct_list[0].empty && ver_struct_list[2].empty)
2762 if (_hor_struct_list !=
nullptr) {
2764 hor_struct_list.
resize(3);
2767 hor_struct_list[0].init();
2768 hor_struct_list[0].stretch = 0;
2769 hor_struct_list[0].sizeHint = left_hint.
width();
2770 hor_struct_list[0].minimumSize = left_min.
width();
2771 hor_struct_list[0].maximumSize = left_max.
width();
2772 hor_struct_list[0].expansive =
false;
2778 hor_struct_list[1].init();
2779 hor_struct_list[1].stretch = center_hint.
width();
2790 int top = (tl_significant && tr_significant) ? top_hint.
width() : 0;
2791 int bottom = (bl_significant && br_significant) ? bottom_hint.
width() : 0;
2794 top = (tl_significant && tr_significant) ? top_min.
width() : 0;
2795 bottom = (bl_significant && br_significant) ? bottom_min.
width() : 0;
2798 hor_struct_list[1].maximumSize = center_max.
width();
2799 hor_struct_list[1].expansive = have_central;
2800 hor_struct_list[1].
empty = !have_central;
2801 hor_struct_list[1].pos = center_rect.
left();
2802 hor_struct_list[1].
size = center_rect.
width();
2805 hor_struct_list[2].init();
2806 hor_struct_list[2].stretch = 0;
2807 hor_struct_list[2].sizeHint = right_hint.
width();
2808 hor_struct_list[2].minimumSize = right_min.
width();
2809 hor_struct_list[2].maximumSize = right_max.
width();
2810 hor_struct_list[2].expansive =
false;
2815 for (
int i = 0;
i < 3; ++
i) {
2816 hor_struct_list[
i].sizeHint
2819 if (have_central && hor_struct_list[0].empty && hor_struct_list[2].empty)
2833 if (hor_struct_list !=
nullptr) {
2841 if (ver_struct_list !=
nullptr) {
2843 r.setBottom(ver_struct_list->
at(1).pos -
sep - 1);
2853 if (hor_struct_list !=
nullptr) {
2861 if (ver_struct_list !=
nullptr) {
2862 r.setTop(ver_struct_list->
at(2).pos);
2873 if (hor_struct_list !=
nullptr) {
2875 r.setRight(hor_struct_list->
at(1).pos -
sep - 1);
2877 if (ver_struct_list !=
nullptr) {
2880 ?
rect.
top() : ver_struct_list->
at(1).pos);
2893 if (hor_struct_list !=
nullptr) {
2897 if (ver_struct_list !=
nullptr) {
2900 ?
rect.
top() : ver_struct_list->
at(1).pos);
2911 if (hor_struct_list !=
nullptr) {
2915 if (ver_struct_list !=
nullptr) {
2925 getGrid(&ver_struct_list, &hor_struct_list);
2930 setGrid(&ver_struct_list, &hor_struct_list);
2942template<
typename SizePMF,
typename CenterPMF>
2964 int row1 =
top.width();
2965 int row2 =
left.width() + center.width() +
right.width();
2966 int row3 =
bottom.width();
2967 int col1 =
left.height();
2968 int col2 =
top.height() + center.height() +
bottom.height();
2969 int col3 =
right.height();
2972 row1 +=
left.width();
2974 col1 +=
top.height();
2977 row1 +=
right.width();
2979 col3 +=
top.height();
2982 row3 +=
left.width();
2987 row3 +=
right.width();
2991 return QSize(
qMax(row1, row2, row3),
qMax(col1, col2, col3));
3046 for (QDockWidgetGroupWindow *dwgw :
groups) {
3048 if (!
index.isEmpty()) {
3056 if (
index.isEmpty())
3066 if (placeHolder->
window) {
3072 item->placeHolderItem =
nullptr;
3083 if (orientation ==
info.o ||
info.item_list.
size() <= 1) {
3086 info.o = orientation;
3089 info.item_list.append(new_item);
3090#if QT_CONFIG(tabbar)
3091 if (
info.tabbed && !new_item.
skip()) {
3092 info.updateTabBar();
3093 info.setCurrentTabId(tabId(new_item));
3097#if QT_CONFIG(tabbar)
3098 int tbshape =
info.tabBarShape;
3111#if QT_CONFIG(tabbar)
3130 qWarning(
"QMainWidget::resizeDocks: size of the lists are not the same");
3138 qWarning(
"QMainWidget::resizeDocks: one QDockWidget is not part of the layout");
3143 qWarning(
"QMainWidget::resizeDocks: all sizes need to be larger than 0");
3147 while (
path.size() > 1) {
3149#if QT_CONFIG(tabbar)
3166 const int dockNum =
path.constFirst();
3168 QRect &
r = this->docks[dockNum].rect;
3200#if QT_CONFIG(tabbar)
3202 updateSeparatorWidgets();
3208 const QPoint &mouse)
const
3246 if (separator.
size() > 1) {
3248 delta =
pick(
info->o, dest - origin);
3250 delta =
info->separatorMove(
index, delta);
3268 delta =
pick(
o, dest - origin);
3289 delta =
pick(
info->o, dest - origin);
3291 delta =
info->separatorMove(
index, delta);
3296#if QT_CONFIG(tabbar)
3299void QDockAreaLayout::updateSeparatorWidgets()
const
3312 qWarning(
"QDockAreaLayout::updateSeparatorWidgets: null separator widget");
3378#if QT_CONFIG(tabbar)
3384 result += dock.usedTabBars();
3394 result.reserve(numSeparators);
3395 for (
int i = 0;
i < numSeparators; ++
i)
3399 result += dock.usedSeparatorWidgets();
3408 if (
info ==
nullptr)
3411 if (index < 0 || index >=
info->item_list.
size())
3422 if (
item.size != -1)
\inmodule QtCore\reentrant
QLayoutItem * plug(const QList< int > &path)
void split(int index, Qt::Orientation orientation, QLayoutItem *dockWidgetItem)
QMainWindowLayout * mainWindowLayout() const
QSize minimumSize() const
QLayoutItem * takeAt(int *x, int index)
bool hasFixedSize() const
bool expansive(Qt::Orientation o) const
bool restoreState(QDataStream &stream, QList< QDockWidget * > &widgets, bool testing)
QRect separatorRect(int index) const
QDockWidget * apply(bool animate)
QInternal::DockPosition dockPos
QDockAreaLayoutItem & item(const QList< int > &path)
bool onlyHasPlaceholders() const
void saveState(QDataStream &stream) const
void paintSeparators(QPainter *p, QWidget *widget, const QRegion &clip, const QPoint &mouse) const
QLayoutItem * itemAt(int *x, int index) const
QList< int > indexOf(QWidget *widget) const
QList< QDockAreaLayoutItem > item_list
bool insertGap(const QList< int > &path, QLayoutItem *dockWidgetItem)
QLayoutItem * unplug(const QList< int > &path)
QRect itemRect(int index, bool isGap=false) const
QList< int > findSeparator(const QPoint &pos) const
void remove(const QList< int > &path)
int separatorMove(int index, int delta)
QList< int > indexOfPlaceHolder(const QString &objectName) const
QDockAreaLayoutInfo * info(const QList< int > &path)
QSize maximumSize() const
void deleteAllLayoutItems()
QRegion separatorRegion() const
QList< QWidget * > separatorWidgets
QList< int > gapIndex(const QPoint &pos, bool nestingEnabled, TabMode tabMode) const
bool hasGapItem(const QList< int > &path) const
QRect itemRect(const QList< int > &path) const
QSize size_helper(SizePMF sizeFn, CenterPMF centerFn) const
QLayoutItem * centralWidgetItem
QLayoutItem * itemAt(int *x, int index) const
QLayoutItem * unplug(const QList< int > &path)
QLayoutItem * plug(const QList< int > &path)
QList< int > gapIndex(const QPoint &pos, bool disallowTabs) const
QDockAreaLayoutInfo * info(const QList< int > &path)
void splitDockWidget(QDockWidget *after, QDockWidget *dockWidget, Qt::Orientation orientation)
QList< int > findSeparator(const QPoint &pos) const
bool restoreDockWidget(QDockWidget *dockWidget)
void setGrid(QList< QLayoutStruct > *ver_struct_list, QList< QLayoutStruct > *hor_struct_list)
QSize minimumSize() const
bool restoreState(QDataStream &stream, const QList< QDockWidget * > &widgets, bool testing=false)
void resizeDocks(const QList< QDockWidget * > &docks, const QList< int > &sizes, Qt::Orientation o)
QRect gapRect(const QList< int > &path) const
QDockAreaLayout(QMainWindow *win)
void addDockWidget(QInternal::DockPosition pos, QDockWidget *dockWidget, Qt::Orientation orientation)
void keepSize(QDockWidget *w)
QList< int > indexOfPlaceHolder(const QString &objectName) const
void remove(const QList< int > &path)
QDockAreaLayoutItem & item(const QList< int > &path)
QSize minimumStableSize() const
void deleteAllLayoutItems()
static QRect constrainedRect(QRect rect, QWidget *widget)
QRect separatorRect(int index) const
void removePlaceHolder(const QString &name)
void getGrid(QList< QLayoutStruct > *ver_struct_list, QList< QLayoutStruct > *hor_struct_list)
QDockAreaLayoutInfo docks[4]
QRegion separatorRegion() const
int separatorMove(const QList< int > &separator, const QPoint &origin, const QPoint &dest)
Qt::DockWidgetArea corners[4]
bool insertGap(const QList< int > &path, QLayoutItem *dockWidgetItem)
void paintSeparators(QPainter *p, QWidget *widget, const QRegion &clip, const QPoint &mouse) const
QLayoutItem * takeAt(int *x, int index)
QList< QWidget * > separatorWidgets
void saveState(QDataStream &stream) const
QList< int > indexOf(QWidget *dockWidget) const
qint64 size() const
Returns the file size in bytes.
void show()
Shows the item (items are visible by default).
QPointF pos() const
Returns the position of the item in parent coordinates.
QGraphicsWidget * window() const
qreal x() const
This convenience function is equivalent to calling pos().x().
GraphicsItemFlags flags() const
Returns this item's flags.
QScreen * primaryScreen
the primary (or default) screen of the application.
static QScreen * screenAt(const QPoint &point)
Returns the screen at point, or \nullptr if outside of any screen.
The QLayoutItem class provides an abstract item that a QLayout manipulates.
virtual Qt::Orientations expandingDirections() const =0
Returns whether this layout item can make use of more space than sizeHint().
virtual QSize minimumSize() const =0
Implemented in subclasses to return the minimum size of this item.
virtual bool isEmpty() const =0
Implemented in subclasses to return whether this item is empty, i.e.
virtual QSize maximumSize() const =0
Implemented in subclasses to return the maximum size of this item.
virtual QWidget * widget() const
If this item manages a QWidget, returns that widget.
virtual QSize sizeHint() const =0
Implemented in subclasses to return the preferred size of this item.
qsizetype size() const noexcept
void removeAt(qsizetype i)
iterator insert(qsizetype i, parameter_type t)
bool empty() const noexcept
const_reference at(qsizetype i) const noexcept
void move(qsizetype from, qsizetype to)
qsizetype count() const noexcept
void prepend(rvalue_ref t)
void resize(qsizetype size)
void append(parameter_type t)
QWidgetAnimator widgetAnimator
The QMainWindow class provides a main application window.
DockOptions dockOptions
the docking behavior of QMainWindow
QString objectName
the name of this object
QList< T > findChildren(const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
Returns all children of this object with the given name that can be cast to type T,...
The QPainter class performs low-level painting on widgets and other paint devices.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr void adjust(int x1, int y1, int x2, int y2) noexcept
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
constexpr void moveBottom(int pos) noexcept
Moves the rectangle vertically, leaving the rectangle's bottom edge at the given y coordinate.
constexpr void moveRight(int pos) noexcept
Moves the rectangle horizontally, leaving the rectangle's right edge at the given x coordinate.
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr void setRight(int pos) noexcept
Sets the right edge of the rectangle to the given x coordinate.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void moveLeft(int pos) noexcept
Moves the rectangle horizontally, leaving the rectangle's left edge at the given x coordinate.
constexpr void setBottom(int pos) noexcept
Sets the bottom edge of the rectangle to the given y coordinate.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr void setLeft(int pos) noexcept
Sets the left edge of the rectangle to the given x coordinate.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr void setWidth(int w) noexcept
Sets the width of the rectangle to the given width.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr void setHeight(int h) noexcept
Sets the height of the rectangle to the given height.
constexpr void moveTop(int pos) noexcept
Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
constexpr void setTop(int pos) noexcept
Sets the top edge of the rectangle to the given y coordinate.
The QRegion class specifies a clip region for a painter.
bool contains(const QPoint &p) const
Returns true if the region contains the point p; otherwise returns false.
The QScreen class is used to query screen properties. \inmodule QtGui.
QRect geometry
the screen's geometry in pixels
Exception-safe wrapper around QObject::blockSignals().
constexpr QSize boundedTo(const QSize &) const noexcept
Returns a size holding the minimum width and height of this size and the given otherSize.
constexpr int height() const noexcept
Returns the height.
constexpr QSize grownBy(QMargins m) const noexcept
constexpr int width() const noexcept
Returns the width.
constexpr QSize expandedTo(const QSize &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
constexpr bool isNull() const noexcept
Returns true if both the width and height is 0; otherwise returns false.
constexpr bool isValid() const noexcept
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QStyleOption class stores the parameters used by QStyle functions.
@ PM_DockWidgetSeparatorExtent
@ PE_IndicatorDockWidgetResizeHandle
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
The QTabBar class provides a tab bar, e.g.
Shape
This enum type lists the built-in shapes supported by QTabBar.
Combined button and popup list for selecting options.
static int grow(QLayoutStruct &ls, int delta)
static QRect dockedGeometry(QWidget *widget)
static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos)
static int realMinSize(const QDockAreaLayoutInfo &info)
QDebug operator<<(QDebug dbg, const QDockAreaLayoutItem &item)
static int qMax(int i1, int i2, int i3)
static int shrink(QLayoutStruct &ls, int delta)
static int separatorMoveHelper(QList< QLayoutStruct > &list, int index, int delta, int sep)
static QInternal::DockPosition dockPosHelper(const QRect &rect, const QPoint &_pos, Qt::Orientation o, bool nestingEnabled, QDockAreaLayoutInfo::TabMode tabMode)
QMainWindowLayout * qt_mainwindow_layout(const QMainWindow *window)
static void paintSep(QPainter *p, QWidget *w, const QRect &r, Qt::Orientation o, bool mouse_over)
static int realMaxSize(const QDockAreaLayoutInfo &info)
void qGeomCalc(QList< QLayoutStruct > &chain, int start, int count, int pos, int space, int spacer)
QT_BEGIN_NAMESPACE constexpr int QLAYOUTSIZE_MAX
#define Q_LOGGING_CATEGORY(name,...)
#define qCWarning(category,...)
#define qCDebug(category,...)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat GLfloat GLfloat GLfloat h
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLsizei const GLchar *const * path
#define Q_ASSERT_X(cond, x, msg)
static constexpr QChar sep
#define qUtf16Printable(string)
#define QT_CONFIG(feature)
if(qFloatDistance(a, b)<(1<< 7))
[0]
QFileInfo info(fileName)
[8]
QList< QWidget * > widgets
[11]
QPlaceHolderItem * placeHolderItem
QSize maximumSize() const
QDockAreaLayoutItem(QLayoutItem *_widgetItem=nullptr)
bool expansive(Qt::Orientation o) const
bool hasFixedSize(Qt::Orientation o) const
QDockAreaLayoutInfo * subinfo
QDockAreaLayoutItem & operator=(const QDockAreaLayoutItem &other)
QSize minimumSize() const
void init(int stretchFactor=0, int minSize=0)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent