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
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 398 of file qmainwindowlayout_p.h.

Constructor & Destructor Documentation

◆ QMainWindowLayoutState()

QMainWindowLayoutState::QMainWindowLayoutState ( QMainWindow * win)

QDockWidgetGroupWindow is a floating window, containing several QDockWidgets floating together. This requires QMainWindow::GroupedDragging to be enabled. QDockWidgets floating jointly in a QDockWidgetGroupWindow are considered to be docked. Their isFloating property is false. QDockWidget children of a QDockWidgetGroupWindow are either: \list

  • tabbed (as long as Qt is compiled with the tabbar feature), or
  • arranged next to each other, equivalent to the default on a main window dock. \endlist

QDockWidgetGroupWindow uses QDockWidgetGroupLayout to lay out its QDockWidget children. It stores layout information in a QDockAreaLayoutInfo, including temporary spacer items and rubber bands.

If its QDockWidget children are tabbed, the QDockWidgetGroupWindow shows the active QDockWidget's title as its own window title.

QDockWidgetGroupWindow is designed to hold more than one QDockWidget. A QDockWidgetGroupWindow with only one QDockWidget child may occur only temporarily \list

  • in its construction phase, or
  • during a hover: While QDockWidget A is hovered over B, B is converted into a QDockWidgetGroupWindow. \endlist

A QDockWidgetGroupWindow with only one QDockWidget child must never get focus, be dragged or dropped. To enforce this restriction, QDockWidgetGrouWindow will remove itself after its second QDockWidget child has been removed. It will make its last QDockWidget child a single, floating QDockWidget. Eventually, the empty QDockWidgetGroupWindow will call deleteLater() on itself.

Definition at line 760 of file qmainwindowlayout.cpp.

References mainWindow, and win.

Member Function Documentation

◆ apply()

void QMainWindowLayoutState::apply ( bool animated)

Definition at line 837 of file qmainwindowlayout.cpp.

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

+ Here is the call graph for this function:

◆ centralWidget()

QWidget * QMainWindowLayoutState::centralWidget ( ) const

Definition at line 996 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 1268 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 1102 of file qmainwindowlayout.cpp.

References centralWidgetRect, and rect.

Referenced by QMainWindowLayout::restoreState().

+ Here is the caller graph for this function:

◆ contains()

bool QMainWindowLayoutState::contains ( QWidget * widget) const

Definition at line 961 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 873 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 884 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 855 of file qmainwindowlayout.cpp.

References centralWidgetRect, and rect.

Referenced by QMainWindowLayout::restoreState(), 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 817 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 1011 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 1159 of file qmainwindowlayout.cpp.

References i.

◆ indexOf()

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

Definition at line 934 of file qmainwindowlayout.cpp.

References widget.

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

+ Here is the caller graph for this function:

◆ insertGap()

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

Definition at line 1047 of file qmainwindowlayout.cpp.

References i, item, and Q_ASSERT.

◆ isValid()

bool QMainWindowLayoutState::isValid ( ) const

Definition at line 1117 of file qmainwindowlayout.cpp.

References QRect::isValid(), and rect.

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

+ 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 1122 of file qmainwindowlayout.cpp.

References i, and Q_ASSERT.

Referenced by QMainWindowLayout::unplug().

+ Here is the caller graph for this function:

◆ itemAt()

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

Definition at line 895 of file qmainwindowlayout.cpp.

References centralWidgetItem, and ret.

◆ itemRect()

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

Definition at line 1142 of file qmainwindowlayout.cpp.

References i.

Referenced by QMainWindowLayout::unplug().

+ Here is the caller graph for this function:

◆ minimumSize()

QSize QMainWindowLayoutState::minimumSize ( ) const

Definition at line 794 of file qmainwindowlayout.cpp.

References centralWidgetItem, and QLayoutItem::minimumSize().

+ Here is the call graph for this function:

◆ plug()

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

Definition at line 1176 of file qmainwindowlayout.cpp.

References i.

◆ remove() [1/2]

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

Definition at line 1071 of file qmainwindowlayout.cpp.

References i.

◆ remove() [2/2]

void QMainWindowLayoutState::remove ( QLayoutItem * item)

Definition at line 1086 of file qmainwindowlayout.cpp.

References dockWidget, and item.

◆ restoreState()

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

Definition at line 1319 of file qmainwindowlayout.cpp.

References ba, checkFormat(), QDockAreaLayout::constrainedRect(), copy(), QByteArray::data(), QDockAreaLayout::DockWidgetStateMarker, QDockAreaLayout::FloatingDockWidgetTabMarker, Qt::Horizontal, i, indexOf(), info, QInternal::LeftDock, mainWindow, qt_mainwindow_layout(), QByteArray::resize(), QTabBar::RoundedSouth, QDataStream::setVersion(), QByteArray::size(), QRect::size(), QToolBarAreaLayout::ToolBarStateMarker, QToolBarAreaLayout::ToolBarStateMarkerEx, and QRect::topLeft().

Referenced by QMainWindowLayout::restoreState().

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

◆ saveState()

void QMainWindowLayoutState::saveState ( QDataStream & stream) const

Definition at line 1212 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 980 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 775 of file qmainwindowlayout.cpp.

References centralWidgetItem, and QLayoutItem::sizeHint().

+ Here is the call graph for this function:

◆ takeAt()

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

Definition at line 913 of file qmainwindowlayout.cpp.

References centralWidgetItem, and ret.

◆ unplug()

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

Definition at line 1193 of file qmainwindowlayout.cpp.

References i, other(), and Q_UNUSED.

Referenced by 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 414 of file qmainwindowlayout_p.h.

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

◆ mainWindow

QMainWindow* QMainWindowLayoutState::mainWindow

◆ rect

QRect QMainWindowLayoutState::rect

Definition at line 401 of file qmainwindowlayout_p.h.

Referenced by clear(), fitLayout(), isValid(), and QMainWindowLayout::restoreState().


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