Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QMainWindowLayoutState Class Reference

#include <qmainwindowlayout_p.h>

+ Collaboration diagram for QMainWindowLayoutState:

Public Member Functions

 QMainWindowLayoutState (QMainWindow *win)
 
void apply (bool animated)
 
void deleteAllLayoutItems ()
 
void deleteCentralWidgetItem ()
 
QSize sizeHint () const
 
QSize minimumSize () const
 
bool fits () const
 
void fitLayout ()
 
QLayoutItemitemAt (int index, int *x) const
 
QLayoutItemtakeAt (int index, int *x)
 
QList< int > indexOf (QWidget *widget) const
 
QLayoutItemitem (const QList< int > &path)
 
QRect itemRect (const QList< int > &path) const
 
QRect gapRect (const QList< int > &path) const
 
bool contains (QWidget *widget) const
 
void setCentralWidget (QWidget *widget)
 
QWidgetcentralWidget () const
 
QList< int > gapIndex (QWidget *widget, const QPoint &pos) const
 
bool insertGap (const QList< int > &path, QLayoutItem *item)
 
void remove (const QList< int > &path)
 
void remove (QLayoutItem *item)
 
void clear ()
 
bool isValid () const
 
QLayoutItemplug (const QList< int > &path)
 
QLayoutItemunplug (const QList< int > &path, QMainWindowLayoutState *savedState=nullptr)
 
void saveState (QDataStream &stream) const
 
bool checkFormat (QDataStream &stream)
 
bool restoreState (QDataStream &stream, const QMainWindowLayoutState &oldState)
 

Public Attributes

QRect rect
 
QMainWindowmainWindow
 
QLayoutItemcentralWidgetItem
 
QRect centralWidgetRect
 

Detailed Description

Definition at line 383 of file qmainwindowlayout_p.h.

Constructor & Destructor Documentation

◆ QMainWindowLayoutState()

QMainWindowLayoutState::QMainWindowLayoutState ( QMainWindow win)

Definition at line 604 of file qmainwindowlayout.cpp.

References mainWindow, and win.

Member Function Documentation

◆ apply()

void QMainWindowLayoutState::apply ( bool  animated)

Definition at line 681 of file qmainwindowlayout.cpp.

References centralWidgetItem, centralWidgetRect, layout, mainWindow, Q_ASSERT, qt_mainwindow_layout(), and QLayoutItem::widget().

Referenced by QMainWindowLayout::animationFinished().

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

◆ centralWidget()

QWidget * QMainWindowLayoutState::centralWidget ( ) const

Definition at line 840 of file qmainwindowlayout.cpp.

References centralWidgetItem, and item.

Referenced by QMainWindowLayout::centralWidget().

+ Here is the caller graph for this function:

◆ checkFormat()

bool QMainWindowLayoutState::checkFormat ( QDataStream stream)

Definition at line 1112 of file qmainwindowlayout.cpp.

References QDockAreaLayout::DockWidgetStateMarker, QDockAreaLayout::FloatingDockWidgetTabMarker, info, mainWindow, QToolBarAreaLayout::ToolBarStateMarker, and QToolBarAreaLayout::ToolBarStateMarkerEx.

Referenced by restoreState().

+ Here is the caller graph for this function:

◆ clear()

void QMainWindowLayoutState::clear ( )

Definition at line 946 of file qmainwindowlayout.cpp.

References centralWidgetRect, and rect.

Referenced by QMainWindowLayout::animationFinished(), QMainWindowLayout::restore(), and QMainWindowLayout::restoreState().

+ Here is the caller graph for this function:

◆ contains()

bool QMainWindowLayoutState::contains ( QWidget widget) const

Definition at line 805 of file qmainwindowlayout.cpp.

References centralWidgetItem, widget, and QLayoutItem::widget().

+ Here is the call graph for this function:

◆ deleteAllLayoutItems()

void QMainWindowLayoutState::deleteAllLayoutItems ( )

Definition at line 717 of file qmainwindowlayout.cpp.

Referenced by QMainWindowLayout::~QMainWindowLayout(), and QMainWindowLayout::restoreState().

+ Here is the caller graph for this function:

◆ deleteCentralWidgetItem()

void QMainWindowLayoutState::deleteCentralWidgetItem ( )

Definition at line 728 of file qmainwindowlayout.cpp.

References centralWidgetItem.

Referenced by QMainWindowLayout::~QMainWindowLayout(), and setCentralWidget().

+ Here is the caller graph for this function:

◆ fitLayout()

void QMainWindowLayoutState::fitLayout ( )

Definition at line 699 of file qmainwindowlayout.cpp.

References centralWidgetRect, and rect.

Referenced by QMainWindowLayout::restoreState(), QMainWindowLayout::revert(), QMainWindowLayout::setGeometry(), and QMainWindowLayout::unplug().

+ Here is the caller graph for this function:

◆ fits()

bool QMainWindowLayoutState::fits ( ) const

Returns whether the layout fits into the main window.

Definition at line 661 of file qmainwindowlayout.cpp.

References QInternal::BottomDock, QWidget::height, QInternal::LeftDock, mainWindow, Q_ASSERT, QInternal::RightDock, QInternal::TopDock, and QWidget::width.

Referenced by QMainWindowLayout::restoreState().

+ Here is the caller graph for this function:

◆ gapIndex()

QList< int > QMainWindowLayoutState::gapIndex ( QWidget widget,
const QPoint pos 
) const

Definition at line 855 of file qmainwindowlayout.cpp.

References pos, and widget.

Referenced by QMainWindowLayout::hover().

+ Here is the caller graph for this function:

◆ gapRect()

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

Definition at line 1003 of file qmainwindowlayout.cpp.

References i.

◆ indexOf()

QList< int > QMainWindowLayoutState::indexOf ( QWidget widget) const

Definition at line 778 of file qmainwindowlayout.cpp.

References widget.

Referenced by QMainWindowLayout::animationFinished(), QMainWindowLayout::plug(), restoreState(), QMainWindowLayout::revert(), and QMainWindowLayout::unplug().

+ Here is the caller graph for this function:

◆ insertGap()

bool QMainWindowLayoutState::insertGap ( const QList< int > &  path,
QLayoutItem item 
)

Definition at line 891 of file qmainwindowlayout.cpp.

References i, item, and Q_ASSERT.

◆ isValid()

bool QMainWindowLayoutState::isValid ( ) const

Definition at line 961 of file qmainwindowlayout.cpp.

References QRect::isValid(), and rect.

Referenced by QMainWindowLayout::hover(), QMainWindowLayout::restore(), QMainWindowLayout::revert(), QMainWindowLayout::setCentralWidget(), QMainWindowLayout::setGeometry(), and QMainWindowLayout::takeAt().

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

◆ item()

QLayoutItem * QMainWindowLayoutState::item ( const QList< int > &  path)

Definition at line 966 of file qmainwindowlayout.cpp.

References i, Q_ASSERT, and QToolBarAreaLayoutItem::widgetItem.

Referenced by QMainWindowLayout::unplug().

+ Here is the caller graph for this function:

◆ itemAt()

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

Definition at line 739 of file qmainwindowlayout.cpp.

References centralWidgetItem, and ret.

Referenced by QMainWindowLayout::itemAt().

+ Here is the caller graph for this function:

◆ itemRect()

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

Definition at line 986 of file qmainwindowlayout.cpp.

References i.

Referenced by QMainWindowLayout::revert(), QMainWindowLayout::takeAt(), and QMainWindowLayout::unplug().

+ Here is the caller graph for this function:

◆ minimumSize()

QSize QMainWindowLayoutState::minimumSize ( ) const

Definition at line 638 of file qmainwindowlayout.cpp.

References centralWidgetItem, and QLayoutItem::minimumSize().

Referenced by QMainWindowLayout::minimumSize().

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

◆ plug()

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

Definition at line 1020 of file qmainwindowlayout.cpp.

References i.

Referenced by QMainWindowLayout::plug().

+ Here is the caller graph for this function:

◆ remove() [1/2]

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

Definition at line 915 of file qmainwindowlayout.cpp.

References i.

Referenced by QMainWindowLayout::plug(), and QMainWindowLayout::takeAt().

+ Here is the caller graph for this function:

◆ remove() [2/2]

void QMainWindowLayoutState::remove ( QLayoutItem item)

Definition at line 930 of file qmainwindowlayout.cpp.

References dockWidget, QListSpecialMethodsBase< T >::indexOf(), and item.

+ Here is the call graph for this function:

◆ restoreState()

bool QMainWindowLayoutState::restoreState ( QDataStream stream,
const QMainWindowLayoutState oldState 
)

◆ saveState()

void QMainWindowLayoutState::saveState ( QDataStream stream) const

Definition at line 1056 of file qmainwindowlayout.cpp.

References QObject::findChildren(), Qt::FindDirectChildrenOnly, QDockAreaLayout::FloatingDockWidgetTabMarker, and mainWindow.

Referenced by QMainWindowLayout::saveState().

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

◆ setCentralWidget()

void QMainWindowLayoutState::setCentralWidget ( QWidget widget)

Definition at line 824 of file qmainwindowlayout.cpp.

References centralWidgetItem, deleteCentralWidgetItem(), item, and widget.

Referenced by QMainWindowLayout::setCentralWidget().

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

◆ sizeHint()

QSize QMainWindowLayoutState::sizeHint ( ) const

Definition at line 619 of file qmainwindowlayout.cpp.

References centralWidgetItem, and QLayoutItem::sizeHint().

Referenced by QMainWindowLayout::sizeHint().

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

◆ takeAt()

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

Definition at line 757 of file qmainwindowlayout.cpp.

References centralWidgetItem, and ret.

Referenced by QMainWindowLayout::takeAt().

+ Here is the caller graph for this function:

◆ unplug()

QLayoutItem * QMainWindowLayoutState::unplug ( const QList< int > &  path,
QMainWindowLayoutState savedState = nullptr 
)

Definition at line 1037 of file qmainwindowlayout.cpp.

References i, other(), and Q_UNUSED.

Referenced by QMainWindowLayout::revert(), and QMainWindowLayout::unplug().

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

Member Data Documentation

◆ centralWidgetItem

◆ centralWidgetRect

QRect QMainWindowLayoutState::centralWidgetRect

Definition at line 399 of file qmainwindowlayout_p.h.

Referenced by apply(), clear(), and fitLayout().

◆ mainWindow

QMainWindow* QMainWindowLayoutState::mainWindow

◆ rect

QRect QMainWindowLayoutState::rect

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