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
QDockAreaLayout Class Reference

#include <qdockarealayout_p.h>

+ Collaboration diagram for QDockAreaLayout:

Public Types

enum  { EmptyDropAreaSize = 80 }
 
enum  { DockWidgetStateMarker = 0xfd , FloatingDockWidgetTabMarker = 0xf9 }
 

Public Member Functions

 QDockAreaLayout (QMainWindow *win)
 
bool isValid () const
 
void saveState (QDataStream &stream) const
 
bool restoreState (QDataStream &stream, const QList< QDockWidget * > &widgets, bool testing=false)
 
QList< int > indexOfPlaceHolder (const QString &objectName) const
 
QList< int > indexOf (QWidget *dockWidget) const
 
QList< int > gapIndex (const QPoint &pos, bool disallowTabs) const
 
QList< int > findSeparator (const QPoint &pos) const
 
QDockAreaLayoutItemitem (const QList< int > &path)
 
QDockAreaLayoutInfoinfo (const QList< int > &path)
 
const QDockAreaLayoutInfoinfo (const QList< int > &path) const
 
QDockAreaLayoutInfoinfo (QWidget *widget)
 
QRect itemRect (const QList< int > &path) const
 
QRect separatorRect (int index) const
 
QRect separatorRect (const QList< int > &path) const
 
bool insertGap (const QList< int > &path, QLayoutItem *dockWidgetItem)
 
QLayoutItemplug (const QList< int > &path)
 
QLayoutItemunplug (const QList< int > &path)
 
void remove (const QList< int > &path)
 
void removePlaceHolder (const QString &name)
 
void fitLayout ()
 
void clear ()
 
QSize sizeHint () const
 
QSize minimumSize () const
 
QSize minimumStableSize () const
 
template<typename SizePMF , typename CenterPMF >
QSize size_helper (SizePMF sizeFn, CenterPMF centerFn) const
 
void addDockWidget (QInternal::DockPosition pos, QDockWidget *dockWidget, Qt::Orientation orientation)
 
bool restoreDockWidget (QDockWidget *dockWidget)
 
void splitDockWidget (QDockWidget *after, QDockWidget *dockWidget, Qt::Orientation orientation)
 
void resizeDocks (const QList< QDockWidget * > &docks, const QList< int > &sizes, Qt::Orientation o)
 
void apply (bool animate)
 
void paintSeparators (QPainter *p, QWidget *widget, const QRegion &clip, const QPoint &mouse) const
 
QRegion separatorRegion () const
 
int separatorMove (const QList< int > &separator, const QPoint &origin, const QPoint &dest)
 
QLayoutItemitemAt (int *x, int index) const
 
QLayoutItemtakeAt (int *x, int index)
 
void deleteAllLayoutItems ()
 
void getGrid (QList< QLayoutStruct > *ver_struct_list, QList< QLayoutStruct > *hor_struct_list)
 
void setGrid (QList< QLayoutStruct > *ver_struct_list, QList< QLayoutStruct > *hor_struct_list)
 
QRect gapRect (const QList< int > &path) const
 
QRect gapRect (QInternal::DockPosition dockPos) const
 
void keepSize (QDockWidget *w)
 
void styleChangedEvent ()
 

Static Public Member Functions

static QRect constrainedRect (QRect rect, QWidget *widget)
 

Public Attributes

Qt::DockWidgetArea corners [4]
 
QRect rect
 
QLayoutItemcentralWidgetItem
 
QMainWindowmainWindow
 
QRect centralWidgetRect
 
QDockAreaLayoutInfo docks [4]
 
int sep
 
bool fallbackToSizeHints
 
QList< QWidget * > separatorWidgets
 

Detailed Description

Definition at line 196 of file qdockarealayout_p.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
EmptyDropAreaSize 

Definition at line 199 of file qdockarealayout_p.h.

◆ anonymous enum

anonymous enum
Enumerator
DockWidgetStateMarker 
FloatingDockWidgetTabMarker 

Definition at line 214 of file qdockarealayout_p.h.

Constructor & Destructor Documentation

◆ QDockAreaLayout()

QDockAreaLayout::QDockAreaLayout ( QMainWindow * win)

Member Function Documentation

◆ addDockWidget()

void QDockAreaLayout::addDockWidget ( QInternal::DockPosition pos,
QDockWidget * dockWidget,
Qt::Orientation orientation )

Definition at line 3120 of file qdockarealayout.cpp.

References docks, dockWidget, info, mainWindow, QObject::objectName, pos, removePlaceHolder(), and sep.

+ Here is the call graph for this function:

◆ apply()

void QDockAreaLayout::apply ( bool animate)

Definition at line 3232 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

void QDockAreaLayout::clear ( )

Definition at line 2975 of file qdockarealayout.cpp.

References centralWidgetRect, clear(), QInternal::DockCount, docks, i, and rect.

Referenced by clear().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ constrainedRect()

QRect QDockAreaLayout::constrainedRect ( QRect rect,
QWidget * widget )
static

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 3062 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteAllLayoutItems()

void QDockAreaLayout::deleteAllLayoutItems ( )

Definition at line 3414 of file qdockarealayout.cpp.

References deleteAllLayoutItems(), QInternal::DockCount, docks, and i.

Referenced by deleteAllLayoutItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findSeparator()

QList< int > QDockAreaLayout::findSeparator ( const QPoint & pos) const

Definition at line 2531 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().

+ Here is the call graph for this function:

◆ fitLayout()

void QDockAreaLayout::fitLayout ( )

Definition at line 2963 of file qdockarealayout.cpp.

References getGrid(), QRect::height(), QRect::left(), qGeomCalc(), rect, sep, setGrid(), QRect::top(), and QRect::width().

Referenced by styleChangedEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gapIndex()

QList< int > QDockAreaLayout::gapIndex ( const QPoint & pos,
bool disallowTabs ) const

◆ gapRect() [1/2]

QRect QDockAreaLayout::gapRect ( const QList< int > & path) const

Definition at line 3447 of file qdockarealayout.cpp.

References info.

Referenced by gapIndex().

+ Here is the caller graph for this function:

◆ gapRect() [2/2]

QRect QDockAreaLayout::gapRect ( QInternal::DockPosition dockPos) const

Definition at line 2494 of file qdockarealayout.cpp.

References QRect::bottom(), QInternal::BottomDock, QInternal::DockCount, EmptyDropAreaSize, QRect::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(), and QWidget::width.

+ Here is the call graph for this function:

◆ getGrid()

◆ indexOf()

QList< int > QDockAreaLayout::indexOf ( QWidget * dockWidget) const

Definition at line 2432 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, dockWidget, i, QDockAreaLayoutInfo::indexOf(), and QList< T >::prepend().

Referenced by keepSize(), resizeDocks(), and splitDockWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ indexOfPlaceHolder()

QList< int > QDockAreaLayout::indexOfPlaceHolder ( const QString & objectName) const

Definition at line 2420 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, i, QDockAreaLayoutInfo::indexOfPlaceHolder(), and QList< T >::prepend().

Referenced by removePlaceHolder(), and restoreDockWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ info() [1/3]

QDockAreaLayoutInfo * QDockAreaLayout::info ( const QList< int > & path)

Definition at line 2566 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, QDockAreaLayoutInfo::info(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ info() [2/3]

const QDockAreaLayoutInfo * QDockAreaLayout::info ( const QList< int > & path) const

Definition at line 2578 of file qdockarealayout.cpp.

References info.

◆ info() [3/3]

QDockAreaLayoutInfo * QDockAreaLayout::info ( QWidget * widget)

Definition at line 2556 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, i, info, and widget.

◆ insertGap()

bool QDockAreaLayout::insertGap ( const QList< int > & path,
QLayoutItem * dockWidgetItem )

Definition at line 2633 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, QDockAreaLayoutInfo::insertGap(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ isValid()

bool QDockAreaLayout::isValid ( ) const

Definition at line 2351 of file qdockarealayout.cpp.

References QRect::isValid(), and rect.

Referenced by styleChangedEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ item()

QDockAreaLayoutItem & QDockAreaLayout::item ( const QList< int > & path)

Definition at line 2583 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, QDockAreaLayoutInfo::item(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ itemAt()

QLayoutItem * QDockAreaLayout::itemAt ( int * x,
int index ) const

Definition at line 3379 of file qdockarealayout.cpp.

References centralWidgetItem, QInternal::DockCount, docks, i, Q_ASSERT, and ret.

◆ itemRect()

QRect QDockAreaLayout::itemRect ( const QList< int > & path) const

Definition at line 2591 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, QDockAreaLayoutInfo::itemRect(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ keepSize()

void QDockAreaLayout::keepSize ( QDockWidget * w)

Definition at line 3458 of file qdockarealayout.cpp.

References QGraphicsItem::flags(), indexOf(), item, and QDockAreaLayoutItem::KeepSize.

+ Here is the call graph for this function:

◆ minimumSize()

QSize QDockAreaLayout::minimumSize ( ) const

Definition at line 3041 of file qdockarealayout.cpp.

References QDockAreaLayoutInfo::minimumSize(), QLayoutItem::minimumSize(), and size_helper().

Referenced by getGrid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ minimumStableSize()

QSize QDockAreaLayout::minimumStableSize ( ) const

Returns the smallest size that doesn't change the size of any of the dock areas.

Definition at line 3051 of file qdockarealayout.cpp.

References QLayoutItem::minimumSize(), QDockAreaLayoutInfo::size(), and size_helper().

+ Here is the call graph for this function:

◆ paintSeparators()

void QDockAreaLayout::paintSeparators ( QPainter * p,
QWidget * widget,
const QRegion & clip,
const QPoint & mouse ) const

Definition at line 3248 of file qdockarealayout.cpp.

References QRegion::contains(), QInternal::DockCount, docks, Qt::Horizontal, i, paintSep(), separatorRect(), Qt::Vertical, and widget.

+ Here is the call graph for this function:

◆ plug()

QLayoutItem * QDockAreaLayout::plug ( const QList< int > & path)

Definition at line 2641 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, item, mainWindow, QDockAreaLayoutInfo::plug(), and Q_ASSERT.

+ Here is the call graph for this function:

◆ remove()

void QDockAreaLayout::remove ( const QList< int > & path)

Definition at line 2663 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, Q_ASSERT, and QDockAreaLayoutInfo::remove().

Referenced by removePlaceHolder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removePlaceHolder()

void QDockAreaLayout::removePlaceHolder ( const QString & name)

Definition at line 2671 of file qdockarealayout.cpp.

References QObject::findChildren(), Qt::FindDirectChildrenOnly, indexOfPlaceHolder(), mainWindow, and remove().

Referenced by addDockWidget(), and splitDockWidget().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resizeDocks()

void QDockAreaLayout::resizeDocks ( const QList< QDockWidget * > & docks,
const QList< int > & sizes,
Qt::Orientation o )

Definition at line 3168 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, fallbackToSizeHints, i, indexOf(), info, item, o, pick(), Q_ASSERT, Q_UNLIKELY, qWarning, rpick(), sep, and QDockAreaLayoutInfo::size().

+ Here is the call graph for this function:

◆ restoreDockWidget()

bool QDockAreaLayout::restoreDockWidget ( QDockWidget * dockWidget)

Definition at line 3083 of file qdockarealayout.cpp.

References constrainedRect(), dockWidget, QObject::findChildren(), Qt::FindDirectChildrenOnly, indexOfPlaceHolder(), item, mainWindow, QObject::objectName, Q_ASSERT, QWidget::setParent(), QWidget::setVisible(), and QWidget::setWindowState().

+ Here is the call graph for this function:

◆ restoreState()

bool QDockAreaLayout::restoreState ( QDataStream & stream,
const QList< QDockWidget * > & widgets,
bool testing = false )

Definition at line 2378 of file qdockarealayout.cpp.

References centralWidgetRect, corners, docks, fallbackToSizeHints, i, ok, pos, QDockAreaLayoutInfo::rect, and restoreState().

Referenced by restoreState().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveState()

void QDockAreaLayout::saveState ( QDataStream & stream) const

Definition at line 2356 of file qdockarealayout.cpp.

References centralWidgetRect, corners, QInternal::DockCount, docks, DockWidgetStateMarker, i, QDockAreaLayoutInfo::isEmpty(), QDockAreaLayoutInfo::rect, QDockAreaLayoutInfo::saveState(), and QRect::size().

+ Here is the call graph for this function:

◆ separatorMove()

int QDockAreaLayout::separatorMove ( const QList< int > & separator,
const QPoint & origin,
const QPoint & dest )

Definition at line 3282 of file qdockarealayout.cpp.

References apply(), fallbackToSizeHints, getGrid(), Qt::Horizontal, info, QInternal::LeftDock, list, o, pick(), QInternal::RightDock, sep, separatorMoveHelper(), setGrid(), QInternal::TopDock, and Qt::Vertical.

+ Here is the call graph for this function:

◆ separatorRect() [1/2]

QRect QDockAreaLayout::separatorRect ( const QList< int > & path) const

Definition at line 2620 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, Q_ASSERT, QDockAreaLayoutInfo::separatorRect(), and separatorRect().

+ Here is the call graph for this function:

◆ separatorRect() [2/2]

QRect QDockAreaLayout::separatorRect ( int index) const

Definition at line 2599 of file qdockarealayout.cpp.

References QInternal::BottomDock, docks, QInternal::LeftDock, QInternal::RightDock, sep, and QInternal::TopDock.

Referenced by findSeparator(), paintSeparators(), separatorRect(), and separatorRegion().

+ Here is the caller graph for this function:

◆ separatorRegion()

QRegion QDockAreaLayout::separatorRegion ( ) const

Definition at line 3267 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, i, and separatorRect().

+ Here is the call graph for this function:

◆ setGrid()

void QDockAreaLayout::setGrid ( QList< QLayoutStruct > * ver_struct_list,
QList< QLayoutStruct > * hor_struct_list )

Definition at line 2867 of file qdockarealayout.cpp.

References 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ size_helper()

template<typename SizePMF , typename CenterPMF >
QSize QDockAreaLayout::size_helper ( SizePMF sizeFn,
CenterPMF centerFn ) const

Definition at line 2985 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sizeHint()

QSize QDockAreaLayout::sizeHint ( ) const

Definition at line 3036 of file qdockarealayout.cpp.

References size_helper(), QDockAreaLayoutInfo::sizeHint(), and QLayoutItem::sizeHint().

Referenced by getGrid().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ splitDockWidget()

void QDockAreaLayout::splitDockWidget ( QDockWidget * after,
QDockWidget * dockWidget,
Qt::Orientation orientation )

Definition at line 3217 of file qdockarealayout.cpp.

References dockWidget, indexOf(), info, QObject::objectName, Q_ASSERT, and removePlaceHolder().

+ Here is the call graph for this function:

◆ styleChangedEvent()

void QDockAreaLayout::styleChangedEvent ( )

Definition at line 3468 of file qdockarealayout.cpp.

References fitLayout(), isValid(), mainWindow, QStyle::pixelMetric(), QStyle::PM_DockWidgetSeparatorExtent, sep, and QWidget::style().

+ Here is the call graph for this function:

◆ takeAt()

QLayoutItem * QDockAreaLayout::takeAt ( int * x,
int index )

Definition at line 3395 of file qdockarealayout.cpp.

References centralWidgetItem, QInternal::DockCount, docks, i, Q_ASSERT, and ret.

◆ unplug()

QLayoutItem * QDockAreaLayout::unplug ( const QList< int > & path)

Definition at line 2655 of file qdockarealayout.cpp.

References QInternal::DockCount, docks, Q_ASSERT, and QDockAreaLayoutInfo::unplug().

+ Here is the call graph for this function:

Member Data Documentation

◆ centralWidgetItem

QLayoutItem* QDockAreaLayout::centralWidgetItem

Definition at line 203 of file qdockarealayout_p.h.

Referenced by QDockAreaLayout(), apply(), getGrid(), itemAt(), size_helper(), and takeAt().

◆ centralWidgetRect

QRect QDockAreaLayout::centralWidgetRect

Definition at line 205 of file qdockarealayout_p.h.

Referenced by apply(), clear(), getGrid(), restoreState(), saveState(), and setGrid().

◆ corners

Qt::DockWidgetArea QDockAreaLayout::corners[4]

◆ docks

◆ fallbackToSizeHints

bool QDockAreaLayout::fallbackToSizeHints

Definition at line 209 of file qdockarealayout_p.h.

Referenced by getGrid(), resizeDocks(), restoreState(), and separatorMove().

◆ mainWindow

◆ rect

QRect QDockAreaLayout::rect

◆ sep

◆ separatorWidgets

QList<QWidget *> QDockAreaLayout::separatorWidgets
mutable

Definition at line 210 of file qdockarealayout_p.h.


The documentation for this class was generated from the following files: