![]() |
Qt 6.x
The Qt SDK
|
#include <qdockarealayout_p.h>
Public Types | |
enum | { EmptyDropAreaSize = 80 } |
enum | { DockWidgetStateMarker = 0xfd , FloatingDockWidgetTabMarker = 0xf9 } |
Static Public Member Functions | |
static QRect | constrainedRect (QRect rect, QWidget *widget) |
Public Attributes | |
Qt::DockWidgetArea | corners [4] |
QRect | rect |
QLayoutItem * | centralWidgetItem |
QMainWindow * | mainWindow |
QRect | centralWidgetRect |
QDockAreaLayoutInfo | docks [4] |
int | sep |
bool | fallbackToSizeHints |
QList< QWidget * > | separatorWidgets |
Definition at line 194 of file qdockarealayout_p.h.
anonymous enum |
Enumerator | |
---|---|
EmptyDropAreaSize |
Definition at line 197 of file qdockarealayout_p.h.
anonymous enum |
Enumerator | |
---|---|
DockWidgetStateMarker | |
FloatingDockWidgetTabMarker |
Definition at line 212 of file qdockarealayout_p.h.
QDockAreaLayout::QDockAreaLayout | ( | QMainWindow * | win | ) |
Definition at line 2283 of file qdockarealayout.cpp.
References QInternal::BottomDock, Qt::BottomDockWidgetArea, Qt::BottomLeftCorner, Qt::BottomRightCorner, centralWidgetItem, corners, docks, Qt::Horizontal, QInternal::LeftDock, mainWindow, QStyle::pixelMetric(), QStyle::PM_DockWidgetSeparatorExtent, QInternal::RightDock, QTabBar::RoundedSouth, sep, QWidget::style(), QInternal::TopDock, Qt::TopDockWidgetArea, Qt::TopLeftCorner, Qt::TopRightCorner, Qt::Vertical, and win.
void QDockAreaLayout::addDockWidget | ( | QInternal::DockPosition | pos, |
QDockWidget * | dockWidget, | ||
Qt::Orientation | orientation | ||
) |
Definition at line 3078 of file qdockarealayout.cpp.
References QList< T >::append(), docks, dockWidget, info, QDockAreaLayoutInfo::item_list, mainWindow, QObject::objectName, pos, removePlaceHolder(), sep, QFileInfo::size(), and QDockAreaLayoutItem::skip().
void QDockAreaLayout::apply | ( | bool | animate | ) |
Definition at line 3190 of file qdockarealayout.cpp.
References QWidgetAnimator::animate(), apply(), centralWidgetItem, centralWidgetRect, QInternal::DockCount, docks, i, QLayoutItem::isEmpty(), mainWindow, qt_mainwindow_layout(), sep, QLayoutItem::widget(), and QMainWindowLayout::widgetAnimator.
Referenced by apply(), and separatorMove().
void QDockAreaLayout::clear | ( | ) |
Definition at line 2933 of file qdockarealayout.cpp.
References centralWidgetRect, clear(), QInternal::DockCount, docks, i, and rect.
Referenced by clear().
Try to fit the given rectangle rect on the screen which contains the window widget. Used to compute the geometry of a dragged a dock widget that should be shown with rect, but needs to be visible on the screen
Definition at line 3020 of file qdockarealayout.cpp.
References QRect::bottom(), QScreen::geometry, QRect::height(), QRect::isValid(), QRect::left(), QRect::moveBottom(), QRect::moveLeft(), QRect::moveRight(), QRect::moveTop(), QGuiApplication::primaryScreen, qMax(), qMin(), rect, QRect::right(), screen, QWidget::screen(), QGuiApplication::screenAt(), QRect::setHeight(), QRect::setWidth(), QRect::top(), QRect::topLeft(), widget, and QRect::width().
Referenced by restoreDockWidget(), QMainWindowLayoutState::restoreState(), and QDockAreaLayoutInfo::restoreState().
void QDockAreaLayout::deleteAllLayoutItems | ( | ) |
Definition at line 3372 of file qdockarealayout.cpp.
References deleteAllLayoutItems(), QInternal::DockCount, docks, and i.
Referenced by deleteAllLayoutItems().
Definition at line 2489 of file qdockarealayout.cpp.
References QRect::adjust(), QRect::contains(), QInternal::DockCount, docks, QDockAreaLayoutInfo::findSeparator(), i, info, QRect::isNull(), pos, QList< T >::prepend(), rect, sep, and separatorRect().
void QDockAreaLayout::fitLayout | ( | ) |
Definition at line 2921 of file qdockarealayout.cpp.
References getGrid(), QRect::height(), QRect::left(), qGeomCalc(), rect, sep, setGrid(), QRect::top(), and QRect::width().
Referenced by styleChangedEvent().
Definition at line 2402 of file qdockarealayout.cpp.
References QMainWindow::AllowNestedDocks, QMainWindow::AllowTabbedDocks, QDockAreaLayoutInfo::AllowTabs, QInternal::DockCount, QMainWindow::dockOptions, docks, QMainWindow::ForceTabbedDocks, QDockAreaLayoutInfo::ForceTabs, QDockAreaLayoutInfo::gapIndex(), gapRect(), i, info, mainWindow, QDockAreaLayoutInfo::NoTabs, pos, QList< T >::prepend(), and QMainWindow::VerticalTabs.
Definition at line 3405 of file qdockarealayout.cpp.
References info, and QFileInfo::size().
Referenced by gapIndex().
QRect QDockAreaLayout::gapRect | ( | QInternal::DockPosition | dockPos | ) | const |
Definition at line 2452 of file qdockarealayout.cpp.
References QRect::bottom(), QInternal::BottomDock, QInternal::DockCount, EmptyDropAreaSize, QRect::height(), QSize::height(), QWidget::height, QRect::left(), QInternal::LeftDock, mainWindow, Q_ASSERT_X, qCWarning, rect, QRect::right(), QInternal::RightDock, sep, QWidget::size, QRect::top(), QInternal::TopDock, QRect::width(), QSize::width(), and QWidget::width.
void QDockAreaLayout::getGrid | ( | QList< QLayoutStruct > * | ver_struct_list, |
QList< QLayoutStruct > * | hor_struct_list | ||
) |
Definition at line 2647 of file qdockarealayout.cpp.
References QRect::bottom(), QInternal::BottomDock, Qt::BottomDockWidgetArea, Qt::BottomLeftCorner, Qt::BottomRightCorner, QSize::boundedTo(), centralWidgetItem, centralWidgetRect, corners, docks, QList< T >::empty(), QSize::expandedTo(), fallbackToSizeHints, QRect::height(), QSize::height(), i, QDockAreaLayoutInfo::isEmpty(), QLayoutItem::isEmpty(), QSize::isNull(), QSize::isValid(), QRect::left(), QInternal::LeftDock, Qt::LeftDockWidgetArea, QDockAreaLayoutInfo::maximumSize(), QLayoutItem::maximumSize(), QDockAreaLayoutInfo::minimumSize(), minimumSize(), QLayoutItem::minimumSize(), qMax(), QWIDGETSIZE_MAX, QDockAreaLayoutInfo::rect, rect, QList< T >::resize(), QRect::right(), QInternal::RightDock, Qt::RightDockWidgetArea, sep, QRect::setBottom(), QRect::setLeft(), QRect::setRight(), QRect::setTop(), QDockAreaLayoutInfo::size(), QList< T >::size(), QRect::size(), QDockAreaLayoutInfo::sizeHint(), sizeHint(), QLayoutItem::sizeHint(), QRect::top(), QInternal::TopDock, Qt::TopDockWidgetArea, Qt::TopLeftCorner, Qt::TopRightCorner, QRect::width(), and QSize::width().
Referenced by fitLayout(), and separatorMove().
Definition at line 2390 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, dockWidget, i, QDockAreaLayoutInfo::indexOf(), and QList< T >::prepend().
Referenced by keepSize(), resizeDocks(), and splitDockWidget().
Definition at line 2378 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, i, QDockAreaLayoutInfo::indexOfPlaceHolder(), and QList< T >::prepend().
Referenced by removePlaceHolder(), and restoreDockWidget().
QDockAreaLayoutInfo * QDockAreaLayout::info | ( | const QList< int > & | path | ) |
Definition at line 2524 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, QDockAreaLayoutInfo::info(), and Q_ASSERT.
const QDockAreaLayoutInfo * QDockAreaLayout::info | ( | const QList< int > & | path | ) | const |
Definition at line 2536 of file qdockarealayout.cpp.
References info.
QDockAreaLayoutInfo * QDockAreaLayout::info | ( | QWidget * | widget | ) |
Definition at line 2514 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, i, info, and widget.
bool QDockAreaLayout::insertGap | ( | const QList< int > & | path, |
QLayoutItem * | dockWidgetItem | ||
) |
Definition at line 2591 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, QDockAreaLayoutInfo::insertGap(), and Q_ASSERT.
bool QDockAreaLayout::isValid | ( | ) | const |
Definition at line 2309 of file qdockarealayout.cpp.
References QRect::isValid(), and rect.
Referenced by styleChangedEvent().
QDockAreaLayoutItem & QDockAreaLayout::item | ( | const QList< int > & | path | ) |
Definition at line 2541 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, QDockAreaLayoutInfo::item(), and Q_ASSERT.
QLayoutItem * QDockAreaLayout::itemAt | ( | int * | x, |
int | index | ||
) | const |
Definition at line 3337 of file qdockarealayout.cpp.
References centralWidgetItem, QInternal::DockCount, docks, i, QDockAreaLayoutInfo::itemAt(), Q_ASSERT, and ret.
Definition at line 2549 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, QDockAreaLayoutInfo::itemRect(), and Q_ASSERT.
void QDockAreaLayout::keepSize | ( | QDockWidget * | w | ) |
Definition at line 3416 of file qdockarealayout.cpp.
References QGraphicsItem::flags(), indexOf(), item, and QDockAreaLayoutItem::KeepSize.
QSize QDockAreaLayout::minimumSize | ( | ) | const |
Definition at line 2999 of file qdockarealayout.cpp.
References QDockAreaLayoutInfo::minimumSize(), QLayoutItem::minimumSize(), and size_helper().
Referenced by getGrid().
QSize QDockAreaLayout::minimumStableSize | ( | ) | const |
Returns the smallest size that doesn't change the size of any of the dock areas.
Definition at line 3009 of file qdockarealayout.cpp.
References QLayoutItem::minimumSize(), QDockAreaLayoutInfo::size(), and size_helper().
void QDockAreaLayout::paintSeparators | ( | QPainter * | p, |
QWidget * | widget, | ||
const QRegion & | clip, | ||
const QPoint & | mouse | ||
) | const |
Definition at line 3206 of file qdockarealayout.cpp.
References QRegion::contains(), QInternal::DockCount, docks, QDockAreaLayoutInfo::hasFixedSize(), Qt::Horizontal, i, QDockAreaLayoutInfo::isEmpty(), QDockAreaLayoutInfo::o, paintSep(), QDockAreaLayoutInfo::paintSeparators(), QDockAreaLayoutInfo::rect, separatorRect(), Qt::Vertical, and widget.
QLayoutItem * QDockAreaLayout::plug | ( | const QList< int > & | path | ) |
Definition at line 2599 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, item, mainWindow, QDockAreaLayoutInfo::plug(), and Q_ASSERT.
Definition at line 2621 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, Q_ASSERT, and QDockAreaLayoutInfo::remove().
Referenced by removePlaceHolder().
Definition at line 2629 of file qdockarealayout.cpp.
References QObject::findChildren(), Qt::FindDirectChildrenOnly, indexOfPlaceHolder(), mainWindow, and remove().
Referenced by addDockWidget(), and splitDockWidget().
void QDockAreaLayout::resizeDocks | ( | const QList< QDockWidget * > & | docks, |
const QList< int > & | sizes, | ||
Qt::Orientation | o | ||
) |
Definition at line 3126 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, fallbackToSizeHints, i, indexOf(), info, item, o, pick(), Q_ASSERT, Q_UNLIKELY, qWarning, rpick(), sep, QFileInfo::size(), and QDockAreaLayoutInfo::size().
bool QDockAreaLayout::restoreDockWidget | ( | QDockWidget * | dockWidget | ) |
Definition at line 3041 of file qdockarealayout.cpp.
References constrainedRect(), dockWidget, QObject::findChildren(), Qt::FindDirectChildrenOnly, QPlaceHolderItem::hidden, indexOfPlaceHolder(), item, mainWindow, QObject::objectName, Q_ASSERT, QWidget::setParent(), QWidget::setVisible(), QWidget::setWindowState(), QPlaceHolderItem::topLevelRect, and QPlaceHolderItem::window.
bool QDockAreaLayout::restoreState | ( | QDataStream & | stream, |
const QList< QDockWidget * > & | widgets, | ||
bool | testing = false |
||
) |
Definition at line 2336 of file qdockarealayout.cpp.
References centralWidgetRect, corners, docks, fallbackToSizeHints, i, ok, QDataStream::Ok, pos, QDataStream::ReadCorruptData, QDockAreaLayoutInfo::rect, and restoreState().
Referenced by restoreState().
void QDockAreaLayout::saveState | ( | QDataStream & | stream | ) | const |
Definition at line 2314 of file qdockarealayout.cpp.
References centralWidgetRect, corners, QInternal::DockCount, docks, DockWidgetStateMarker, i, QDockAreaLayoutInfo::isEmpty(), QDockAreaLayoutInfo::rect, QDockAreaLayoutInfo::saveState(), and QRect::size().
int QDockAreaLayout::separatorMove | ( | const QList< int > & | separator, |
const QPoint & | origin, | ||
const QPoint & | dest | ||
) |
Definition at line 3240 of file qdockarealayout.cpp.
References apply(), fallbackToSizeHints, getGrid(), Qt::Horizontal, info, QList< T >::last(), QInternal::LeftDock, list, o, pick(), QInternal::RightDock, sep, separatorMoveHelper(), setGrid(), QList< T >::size(), QInternal::TopDock, and Qt::Vertical.
Definition at line 2578 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, Q_ASSERT, QDockAreaLayoutInfo::separatorRect(), and separatorRect().
QRect QDockAreaLayout::separatorRect | ( | int | index | ) | const |
Definition at line 2557 of file qdockarealayout.cpp.
References QInternal::BottomDock, docks, QDockAreaLayoutInfo::isEmpty(), QInternal::LeftDock, QDockAreaLayoutInfo::rect, QInternal::RightDock, sep, and QInternal::TopDock.
Referenced by findSeparator(), paintSeparators(), separatorRect(), and separatorRegion().
QRegion QDockAreaLayout::separatorRegion | ( | ) | const |
Definition at line 3225 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, i, QDockAreaLayoutInfo::isEmpty(), separatorRect(), and QDockAreaLayoutInfo::separatorRegion().
void QDockAreaLayout::setGrid | ( | QList< QLayoutStruct > * | ver_struct_list, |
QList< QLayoutStruct > * | hor_struct_list | ||
) |
Definition at line 2825 of file qdockarealayout.cpp.
References QList< T >::at(), QRect::bottom(), QInternal::BottomDock, Qt::BottomDockWidgetArea, Qt::BottomLeftCorner, Qt::BottomRightCorner, centralWidgetRect, corners, docks, QDockAreaLayoutInfo::fitItems(), QRect::left(), QInternal::LeftDock, Qt::LeftDockWidgetArea, QDockAreaLayoutInfo::rect, rect, QRect::right(), QInternal::RightDock, Qt::RightDockWidgetArea, sep, QRect::setHeight(), QRect::setLeft(), QRect::setTop(), QRect::setWidth(), QRect::top(), QInternal::TopDock, Qt::TopDockWidgetArea, Qt::TopLeftCorner, and Qt::TopRightCorner.
Referenced by fitLayout(), and separatorMove().
QSize QDockAreaLayout::size_helper | ( | SizePMF | sizeFn, |
CenterPMF | centerFn | ||
) | const |
Definition at line 2943 of file qdockarealayout.cpp.
References QInternal::BottomDock, Qt::BottomLeftCorner, Qt::BottomRightCorner, centralWidgetItem, corners, docks, QDockAreaLayoutInfo::isEmpty(), QInternal::LeftDock, Qt::LeftDockWidgetArea, qMax(), QInternal::RightDock, Qt::RightDockWidgetArea, sep, QInternal::TopDock, Qt::TopLeftCorner, and Qt::TopRightCorner.
Referenced by minimumSize(), minimumStableSize(), and sizeHint().
QSize QDockAreaLayout::sizeHint | ( | ) | const |
Definition at line 2994 of file qdockarealayout.cpp.
References size_helper(), QDockAreaLayoutInfo::sizeHint(), and QLayoutItem::sizeHint().
Referenced by getGrid().
void QDockAreaLayout::splitDockWidget | ( | QDockWidget * | after, |
QDockWidget * | dockWidget, | ||
Qt::Orientation | orientation | ||
) |
Definition at line 3175 of file qdockarealayout.cpp.
References dockWidget, indexOf(), info, QObject::objectName, Q_ASSERT, and removePlaceHolder().
void QDockAreaLayout::styleChangedEvent | ( | ) |
Definition at line 3426 of file qdockarealayout.cpp.
References fitLayout(), isValid(), mainWindow, QStyle::pixelMetric(), QStyle::PM_DockWidgetSeparatorExtent, sep, and QWidget::style().
QLayoutItem * QDockAreaLayout::takeAt | ( | int * | x, |
int | index | ||
) |
Definition at line 3353 of file qdockarealayout.cpp.
References centralWidgetItem, QInternal::DockCount, docks, i, Q_ASSERT, ret, and QDockAreaLayoutInfo::takeAt().
QLayoutItem * QDockAreaLayout::unplug | ( | const QList< int > & | path | ) |
Definition at line 2613 of file qdockarealayout.cpp.
References QInternal::DockCount, docks, Q_ASSERT, and QDockAreaLayoutInfo::unplug().
QLayoutItem* QDockAreaLayout::centralWidgetItem |
Definition at line 201 of file qdockarealayout_p.h.
Referenced by QDockAreaLayout(), apply(), getGrid(), itemAt(), size_helper(), and takeAt().
QRect QDockAreaLayout::centralWidgetRect |
Definition at line 203 of file qdockarealayout_p.h.
Referenced by apply(), clear(), getGrid(), restoreState(), saveState(), and setGrid().
Qt::DockWidgetArea QDockAreaLayout::corners[4] |
Definition at line 199 of file qdockarealayout_p.h.
Referenced by QDockAreaLayout(), getGrid(), restoreState(), saveState(), setGrid(), and size_helper().
QDockAreaLayoutInfo QDockAreaLayout::docks[4] |
Definition at line 205 of file qdockarealayout_p.h.
Referenced by QDockAreaLayout(), addDockWidget(), apply(), clear(), deleteAllLayoutItems(), findSeparator(), gapIndex(), getGrid(), indexOf(), indexOfPlaceHolder(), info(), info(), insertGap(), item(), itemAt(), itemRect(), paintSeparators(), plug(), remove(), resizeDocks(), restoreState(), saveState(), separatorRect(), separatorRect(), separatorRegion(), setGrid(), size_helper(), takeAt(), and unplug().
bool QDockAreaLayout::fallbackToSizeHints |
Definition at line 207 of file qdockarealayout_p.h.
Referenced by getGrid(), resizeDocks(), restoreState(), and separatorMove().
QMainWindow* QDockAreaLayout::mainWindow |
Definition at line 202 of file qdockarealayout_p.h.
Referenced by QDockAreaLayout(), addDockWidget(), apply(), gapIndex(), gapRect(), plug(), removePlaceHolder(), restoreDockWidget(), and styleChangedEvent().
QRect QDockAreaLayout::rect |
Definition at line 200 of file qdockarealayout_p.h.
Referenced by clear(), constrainedRect(), findSeparator(), fitLayout(), gapRect(), getGrid(), isValid(), and setGrid().
int QDockAreaLayout::sep |
Definition at line 206 of file qdockarealayout_p.h.
Referenced by QDockAreaLayout(), addDockWidget(), apply(), findSeparator(), fitLayout(), gapRect(), getGrid(), resizeDocks(), separatorMove(), separatorRect(), setGrid(), size_helper(), and styleChangedEvent().
Definition at line 208 of file qdockarealayout_p.h.