Qt 4.8
Classes | Public Types | Public Functions | Public Variables | Private Slots | Private Functions | Static Private Functions | List of all members
QMainWindowLayout Class Reference

#include <qmainwindowlayout_p.h>

Inheritance diagram for QMainWindowLayout:
QLayout QObject QLayoutItem

Classes

struct  ToolBarSaveState
 

Public Types

enum  { VersionMarker = 0xff }
 
- Public Types inherited from QLayout
enum  SizeConstraint {
  SetDefaultConstraint, SetNoConstraint, SetMinimumSize, SetFixedSize,
  SetMaximumSize, SetMinAndMaxSize
}
 The possible values are: More...
 

Public Functions

void addDockWidget (Qt::DockWidgetArea area, QDockWidget *dockwidget, Qt::Orientation orientation)
 
void addItem (QLayoutItem *item)
 Implemented in subclasses to add an item. More...
 
void addToolBar (Qt::ToolBarArea area, QToolBar *toolbar, bool needAddChildWidget=true)
 Adds toolbar to area, continuing the current line. More...
 
void addToolBarBreak (Qt::ToolBarArea area)
 
void animationFinished (QWidget *widget)
 
void applyState (QMainWindowLayoutState &newState, bool animate=true)
 
QWidgetcentralWidget () const
 
void cleanUpMacToolbarItems ()
 
Qt::DockWidgetArea corner (Qt::Corner corner) const
 
int count () const
 Must be implemented in subclasses to return the number of items in the layout. More...
 
Qt::DockWidgetArea dockWidgetArea (QDockWidget *dockwidget) const
 
bool documentMode () const
 
bool endSeparatorMove (const QPoint &pos)
 
void fixSizeInUnifiedToolbar (QToolBar *tb) const
 
QWidgetgetSeparatorWidget ()
 
void getStyleOptionInfo (QStyleOptionToolBar *option, QToolBar *toolBar) const
 
QTabBargetTabBar ()
 
QList< int > hover (QLayoutItem *widgetItem, const QPoint &mousePos)
 
void insertIntoMacToolbar (QToolBar *before, QToolBar *after)
 
void insertToolBar (QToolBar *before, QToolBar *toolbar)
 Adds toolbar before before. More...
 
void insertToolBarBreak (QToolBar *before)
 
void invalidate ()
 Reimplemented Function More...
 
QLayoutItemitemAt (int index) const
 Must be implemented in subclasses to return the layout item at index. More...
 
void keepSize (QDockWidget *w)
 
QSize minimumSize () const
 Returns the minimum size of this layout. More...
 
void moveToolBar (QToolBar *toolbar, int pos)
 
void paintDropIndicator (QPainter *p, QWidget *widget, const QRegion &clip)
 
bool plug (QLayoutItem *widgetItem)
 
 QMainWindowLayout (QMainWindow *mainwindow, QLayout *parentLayout)
 
void raise (QDockWidget *widget)
 
void removeFromMacToolbar (QToolBar *toolbar)
 
void removeToolBar (QToolBar *toolbar)
 
void removeToolBarBreak (QToolBar *before)
 
void restore (bool keepSavedState=false)
 
bool restoreDockWidget (QDockWidget *dockwidget)
 
bool restoreState (QDataStream &stream)
 
void revert (QLayoutItem *widgetItem)
 
void saveState (QDataStream &stream) const
 
bool separatorMove (const QPoint &pos)
 
void setCentralWidget (QWidget *cw)
 
void setCorner (Qt::Corner corner, Qt::DockWidgetArea area)
 
void setDockOptions (QMainWindow::DockOptions opts)
 
void setDocumentMode (bool enabled)
 
void setGeometry (const QRect &r)
 Reimplemented Function More...
 
void setStatusBar (QStatusBar *sb)
 
void setTabPosition (Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition)
 
void setTabShape (QTabWidget::TabShape tabShape)
 
void setVerticalTabsEnabled (bool enabled)
 
QSize sizeHint () const
 Implemented in subclasses to return the preferred size of this item. More...
 
void splitDockWidget (QDockWidget *after, QDockWidget *dockwidget, Qt::Orientation orientation)
 
bool startSeparatorMove (const QPoint &pos)
 
QStatusBarstatusBar () const
 
void syncUnifiedToolbarVisibility ()
 
void tabifyDockWidget (QDockWidget *first, QDockWidget *second)
 
QTabWidget::TabPosition tabPosition (Qt::DockWidgetArea area) const
 
QTabWidget::TabShape tabShape () const
 
QLayoutItemtakeAt (int index)
 Must be implemented in subclasses to remove the layout item at index from the layout, and return the item. More...
 
void timerEvent (QTimerEvent *e)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
void toggleToolBarsVisible ()
 
Qt::ToolBarArea toolBarArea (QToolBar *toolbar) const
 
bool toolBarBreak (QToolBar *toolBar) const
 
QLayoutItemunplug (QWidget *widget)
 
void updateGapIndicator ()
 
void updateHIToolBarStatus ()
 
bool usesHIToolBar (QToolBar *toolbar) const
 
 ~QMainWindowLayout ()
 
- Public Functions inherited from QLayout
bool activate ()
 Redoes the layout for parentWidget() if necessary. More...
 
void addWidget (QWidget *w)
 Adds widget w to this layout in a manner specific to the layout. More...
 
QMargins contentsMargins () const
 Returns the margins used around the layout. More...
 
QRect contentsRect () const
 Returns the layout's geometry() rectangle, but taking into account the contents margins. More...
 
Qt::Orientations expandingDirections () const
 Returns whether this layout can make use of more space than sizeHint(). More...
 
QRect geometry () const
 Reimplemented Function More...
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const
 
virtual int indexOf (QWidget *) const
 Searches for widget widget in this layout (not including child layouts). More...
 
bool isEmpty () const
 Reimplemented Function More...
 
bool isEnabled () const
 Returns true if the layout is enabled; otherwise returns false. More...
 
QLayoutlayout ()
 Reimplemented Function More...
 
int margin () const
 
QSize maximumSize () const
 Returns the maximum size of this layout. More...
 
QWidgetmenuBar () const
 Returns the menu bar set for this layout, or 0 if no menu bar is set. More...
 
QWidgetparentWidget () const
 Returns the parent widget of this layout, or 0 if this layout is not installed on any widget. More...
 
 QLayout (QWidget *parent)
 Constructs a new top-level QLayout, with parent parent. More...
 
 QLayout ()
 Constructs a new child QLayout. More...
 
void removeItem (QLayoutItem *)
 Removes the layout item item from the layout. More...
 
void removeWidget (QWidget *w)
 Removes the widget widget from the layout. More...
 
bool setAlignment (QWidget *w, Qt::Alignment alignment)
 Sets the alignment for widget w to alignment and returns true if w is found in this layout (not including child layouts); otherwise returns false. More...
 
bool setAlignment (QLayout *l, Qt::Alignment alignment)
 Sets the alignment for the layout l to alignment and returns true if l is found in this layout (not including child layouts); otherwise returns false. More...
 
void setContentsMargins (int left, int top, int right, int bottom)
 Sets the left, top, right, and bottom margins to use around the layout. More...
 
void setContentsMargins (const QMargins &margins)
 Sets the margins to use around the layout. More...
 
void setEnabled (bool)
 Enables this layout if enable is true, otherwise disables it. More...
 
void setMargin (int)
 
void setMenuBar (QWidget *w)
 Tells the geometry manager to place the menu bar widget at the top of parentWidget(), outside QWidget::contentsMargins(). More...
 
void setSizeConstraint (SizeConstraint)
 
void setSpacing (int)
 
SizeConstraint sizeConstraint () const
 
int spacing () const
 
int totalHeightForWidth (int w) const
 Also takes contentsMargins and menu bar into account. More...
 
QSize totalMaximumSize () const
 Also takes contentsMargins and menu bar into account. More...
 
QSize totalMinimumSize () const
 Also takes contentsMargins and menu bar into account. More...
 
QSize totalSizeHint () const
 Also takes contentsMargins and menu bar into account. More...
 
void update ()
 Updates the layout for parentWidget(). More...
 
 ~QLayout ()
 Destroys the layout, deleting all child layouts. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 
- Public Functions inherited from QLayoutItem
Qt::Alignment alignment () const
 Returns the alignment of this item. More...
 
QSizePolicy::ControlTypes controlTypes () const
 Returns the control type(s) for the layout item. More...
 
virtual bool hasHeightForWidth () const
 Returns true if this layout's preferred height depends on its width; otherwise returns false. More...
 
virtual int heightForWidth (int) const
 Returns the preferred height for this layout item, given the width w. More...
 
virtual int minimumHeightForWidth (int) const
 Returns the minimum height this widget needs for the given width, w. More...
 
 QLayoutItem (Qt::Alignment alignment=0)
 Constructs a layout item with an alignment. More...
 
void setAlignment (Qt::Alignment a)
 Sets the alignment of this item to alignment. More...
 
virtual QSpacerItemspacerItem ()
 If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned. More...
 
virtual QWidgetwidget ()
 If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned. More...
 
virtual ~QLayoutItem ()
 Destroys the QLayoutItem. More...
 

Public Variables

bool _documentMode
 
QTabWidget::TabShape _tabShape
 
bool activateUnifiedToolbarAfterFullScreen
 
bool blockVisiblityCheck
 
QHash< QString, QToolBar * > cocoaItemIDToToolbarHash
 
QList< int > currentGapPos
 
QRect currentGapRect
 
QMainWindow::DockOptions dockOptions
 
QRubberBandgapIndicator
 
QMainWindowLayoutState layoutState
 
QSize minSize
 
QList< int > movingSeparator
 
QPoint movingSeparatorOrigin
 
QPoint movingSeparatorPos
 
QWidgetpluggingWidget
 
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
 
QMainWindowLayoutState savedState
 
int sep
 
QBasicTimer separatorMoveTimer
 
QLayoutItemstatusbar
 
QSize szHint
 
QTabWidget::TabPosition tabPositions [4]
 
QList< void * > toolbarItemsCopy
 
QHash< QToolBar *, ToolBarSaveStatetoolbarSaveState
 
QHash< void *, QToolBar * > unifiedToolbarHash
 
QList< QWidget * > unusedSeparatorWidgets
 
QList< QTabBar * > unusedTabBars
 
QSet< QWidget * > usedSeparatorWidgets
 
QSet< QTabBar * > usedTabBars
 
bool verticalTabsEnabled
 
QWidgetAnimator widgetAnimator
 

Private Slots

void tabChanged ()
 

Private Functions

void updateTabBarShapes ()
 

Static Private Functions

static HIToolbarItemRef createQToolBarInHIToolbarItem (QToolBar *toolbar, QMainWindowLayout *layout)
 
static HIToolbarItemRef CreateToolbarItemForIdentifier (CFStringRef identifier, CFTypeRef data)
 
static void qtMacHIToolbarRegisterQToolBarInHIToolborItemClass ()
 
static OSStatus qtmacToolbarDelegate (EventHandlerCallRef, EventRef, void *)
 
static OSStatus qtoolbarInHIToolbarHandler (EventHandlerCallRef inCallRef, EventRef event, void *data)
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Static Public Functions inherited from QLayout
static QSize closestAcceptableSize (const QWidget *w, const QSize &s)
 Returns a size that satisfies all size constraints on widget, including heightForWidth() and that is as close as possible to size. More...
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QLayout
void addChildLayout (QLayout *l)
 This function is called from addLayout() or insertLayout() functions in subclasses to add layout l as a sub-layout. More...
 
void addChildWidget (QWidget *w)
 This function is called from addWidget() functions in subclasses to add w as a managed widget of a layout. More...
 
bool adoptLayout (QLayout *layout)
 
QRect alignmentRect (const QRect &) const
 Returns the rectangle that should be covered when the geometry of this layout is set to r, provided that this layout supports setAlignment(). More...
 
void childEvent (QChildEvent *e)
 Reimplemented Function More...
 
 QLayout (QLayoutPrivate &d, QLayout *, QWidget *)
 
void widgetEvent (QEvent *)
 Performs child widget layout when the parent widget is resized. More...
 
- Protected Functions inherited from QObject
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Protected Variables inherited from QLayoutItem
Qt::Alignment align
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 159 of file qmainwindowlayout_p.h.

Enumerations

◆ anonymous enum

anonymous enum
Enumerator
VersionMarker 

Definition at line 263 of file qmainwindowlayout_p.h.

263  { // sentinel values used to validate state data
264  VersionMarker = 0xff
265  };

Constructors and Destructors

◆ QMainWindowLayout()

QMainWindowLayout::QMainWindowLayout ( QMainWindow mainwindow,
QLayout parentLayout 
)

Definition at line 1686 of file qmainwindowlayout.cpp.

1687  : QLayout(parentLayout ? static_cast<QWidget *>(0) : mainwindow)
1688  , layoutState(mainwindow)
1689  , savedState(mainwindow)
1691  , statusbar(0)
1692 #ifndef QT_NO_DOCKWIDGET
1693 #ifndef QT_NO_TABBAR
1694  , _documentMode(false)
1695  , verticalTabsEnabled(false)
1696 #ifndef QT_NO_TABWIDGET
1698 #endif
1699 #endif
1700 #endif // QT_NO_DOCKWIDGET
1701  , widgetAnimator(this)
1702  , pluggingWidget(0)
1703 #ifndef QT_NO_RUBBERBAND
1704  , gapIndicator(new QRubberBand(QRubberBand::Rectangle, mainwindow))
1705 #endif //QT_NO_RUBBERBAND
1706 #ifdef Q_WS_MAC
1708  , blockVisiblityCheck(false)
1709 #endif
1710 {
1711  if (parentLayout)
1712  setParent(parentLayout);
1713 
1714 #ifndef QT_NO_DOCKWIDGET
1715 #ifndef QT_NO_TABBAR
1716  sep = mainwindow->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, mainwindow);
1717 #endif
1718 
1719 #ifndef QT_NO_TABWIDGET
1720  for (int i = 0; i < QInternal::DockCount; ++i)
1722 #endif
1723 #endif // QT_NO_DOCKWIDGET
1724 
1725 #ifndef QT_NO_RUBBERBAND
1726  // For accessibility to identify this special widget.
1727  gapIndicator->setObjectName(QLatin1String("qt_rubberband"));
1728  gapIndicator->hide();
1729 #endif
1730  pluggingWidget = 0;
1731 
1732  setObjectName(mainwindow->objectName() + QLatin1String("_layout"));
1733 }
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
QMainWindowLayoutState layoutState
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool activateUnifiedToolbarAfterFullScreen
void setParent(QObject *)
Makes the object a child of parent.
Definition: qobject.cpp:1950
QStyle * style() const
Definition: qwidget.cpp:2742
void setObjectName(const QString &name)
Definition: qobject.cpp:1112
QMainWindow::DockOptions dockOptions
QLayout()
Constructs a new child QLayout.
Definition: qlayout.cpp:127
QRubberBand * gapIndicator
QTabWidget::TabPosition tabPositions[4]
QString objectName() const
QWidgetAnimator widgetAnimator
The QRubberBand class provides a rectangle or line that can indicate a selection or a boundary...
Definition: qrubberband.h:58
QMainWindowLayoutState savedState
QTabWidget::TabShape _tabShape

◆ ~QMainWindowLayout()

QMainWindowLayout::~QMainWindowLayout ( )

Definition at line 1735 of file qmainwindowlayout.cpp.

1736 {
1739 
1740 #ifdef Q_WS_MAC
1742 #endif
1743 
1744  delete statusbar;
1745 }
QMainWindowLayoutState layoutState

Functions

◆ addDockWidget()

void QMainWindowLayout::addDockWidget ( Qt::DockWidgetArea  area,
QDockWidget dockwidget,
Qt::Orientation  orientation 
)

Definition at line 1085 of file qmainwindowlayout.cpp.

1088 {
1089  addChildWidget(dockwidget);
1090 
1091  // If we are currently moving a separator, then we need to abort the move, since each
1092  // time we move the mouse layoutState is replaced by savedState modified by the move.
1093  if (!movingSeparator.isEmpty())
1095 
1096  layoutState.dockAreaLayout.addDockWidget(toDockPos(area), dockwidget, orientation);
1097  emit dockwidget->dockLocationChanged(area);
1098  invalidate();
1099 }
void dockLocationChanged(Qt::DockWidgetArea area)
This signal is emitted when the dock widget is moved to another dock area, or is moved to a different...
QMainWindowLayoutState layoutState
void addDockWidget(QInternal::DockPosition pos, QDockWidget *dockWidget, Qt::Orientation orientation)
QDockAreaLayout dockAreaLayout
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void invalidate()
Reimplemented Function
#define emit
Definition: qobjectdefs.h:76
static QInternal::DockPosition toDockPos(Qt::ToolBarArea area)
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
Definition: qlayout.cpp:1045
QList< int > movingSeparator
static int area(const QSize &s)
Definition: qicon.cpp:155
bool endSeparatorMove(const QPoint &pos)

◆ addItem()

void QMainWindowLayout::addItem ( QLayoutItem item)
virtual

Implemented in subclasses to add an item.

How it is added is specific to each subclass.

This function is not usually called in application code. To add a widget to a layout, use the addWidget() function; to add a child layout, use the addLayout() function provided by the relevant QLayout subclass.

Note: The ownership of item is transferred to the layout, and it's the layout's responsibility to delete it.

See also
addWidget(), QBoxLayout::addLayout(), QGridLayout::addLayout()

Implements QLayout.

Definition at line 1484 of file qmainwindowlayout.cpp.

1485 { qWarning("QMainWindowLayout::addItem: Please use the public QMainWindow API instead"); }
Q_CORE_EXPORT void qWarning(const char *,...)

◆ addToolBar()

void QMainWindowLayout::addToolBar ( Qt::ToolBarArea  area,
QToolBar toolbar,
bool  needAddChildWidget = true 
)

Adds toolbar to area, continuing the current line.

Definition at line 863 of file qmainwindowlayout.cpp.

866 {
868 #ifdef Q_WS_MAC
869  if ((area == Qt::TopToolBarArea)
871  insertIntoMacToolbar(0, toolbar);
872  } else
873 #endif
874  {
875  //let's add the toolbar to the layout
876  addChildWidget(toolbar);
878  if (savedState.isValid() && item) {
879  // copy the toolbar also in the saved state
881  }
882  invalidate();
883 
884  //this ensures that the toolbar has the right window flags (not floating any more)
885  toolbar->d_func()->updateWindowFlags(false /*floating*/);
886  }
887 }
QLayoutItem * addToolBar(QInternal::DockPosition pos, QToolBar *toolBar)
QMainWindowLayoutState layoutState
static void validateToolBarArea(Qt::ToolBarArea &area)
void insertIntoMacToolbar(QToolBar *before, QToolBar *after)
void invalidate()
Reimplemented Function
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64
static QInternal::DockPosition toDockPos(Qt::ToolBarArea area)
bool unifiedTitleAndToolBarOnMac
whether the window uses the unified title and toolbar look on Mac OS X
Definition: qmainwindow.h:83
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
Definition: qlayout.cpp:1045
QToolBarAreaLayout toolBarAreaLayout
QMainWindowLayoutState savedState
void insertItem(QInternal::DockPosition pos, QLayoutItem *item)
static int area(const QSize &s)
Definition: qicon.cpp:155

◆ addToolBarBreak()

void QMainWindowLayout::addToolBarBreak ( Qt::ToolBarArea  area)

Definition at line 804 of file qmainwindowlayout.cpp.

805 {
807 
809  if (savedState.isValid())
811 
812  invalidate();
813 }
void addToolBarBreak(QInternal::DockPosition pos)
QMainWindowLayoutState layoutState
static void validateToolBarArea(Qt::ToolBarArea &area)
void invalidate()
Reimplemented Function
static QInternal::DockPosition toDockPos(Qt::ToolBarArea area)
QToolBarAreaLayout toolBarAreaLayout
QMainWindowLayoutState savedState
static int area(const QSize &s)
Definition: qicon.cpp:155

◆ animationFinished()

void QMainWindowLayout::animationFinished ( QWidget widget)

Definition at line 1612 of file qmainwindowlayout.cpp.

Referenced by QWidgetAnimator::abort(), and QWidgetAnimator::animate().

1613 {
1614  //this function is called from within the Widget Animator whenever an animation is finished
1615  //on a certain widget
1616 #ifndef QT_NO_TOOLBAR
1617  if (QToolBar *tb = qobject_cast<QToolBar*>(widget)) {
1618  QToolBarLayout *tbl = qobject_cast<QToolBarLayout*>(tb->layout());
1619  if (tbl->animating) {
1620  tbl->animating = false;
1621  if (tbl->expanded)
1622  tbl->layoutActions(tb->size());
1623  tb->update();
1624  }
1625  }
1626 #endif
1627 
1628  if (widget == pluggingWidget) {
1629 
1630 #ifndef QT_NO_DOCKWIDGET
1631  if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget))
1632  dw->d_func()->plug(currentGapRect);
1633 #endif
1634 #ifndef QT_NO_TOOLBAR
1635  if (QToolBar *tb = qobject_cast<QToolBar*>(widget))
1636  tb->d_func()->plug(currentGapRect);
1637 #endif
1638 
1639  savedState.clear();
1640  currentGapPos.clear();
1641  pluggingWidget = 0;
1642  //applying the state will make sure that the currentGap is updated correctly
1643  //and all the geometries (especially the one from the central widget) is correct
1644  layoutState.apply(false);
1645 
1646 #ifndef QT_NO_DOCKWIDGET
1647 #ifndef QT_NO_TABBAR
1648  if (qobject_cast<QDockWidget*>(widget) != 0) {
1649  // info() might return null if the widget is destroyed while
1650  // animating but before the animationFinished signal is received.
1652  info->setCurrentTab(widget);
1653  }
1654 #endif
1655 #endif
1656  }
1657 
1658  if (!widgetAnimator.animating()) {
1659  //all animations are finished
1660 #ifndef QT_NO_DOCKWIDGET
1662 #ifndef QT_NO_TABBAR
1663  foreach (QTabBar *tab_bar, usedTabBars)
1664  tab_bar->show();
1665 #endif // QT_NO_TABBAR
1666 #endif // QT_NO_DOCKWIDGET
1667  }
1668 
1670 }
QSet< QTabBar * > usedTabBars
static mach_timebase_info_data_t info
The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-l...
Definition: qdockwidget.h:60
QList< int > currentGapPos
QMainWindowLayoutState layoutState
The QTabBar class provides a tab bar, e.g.
Definition: qtabbar.h:59
T * qobject_cast(QObject *object)
Definition: qobject.h:375
void apply(bool animated)
QDockAreaLayout dockAreaLayout
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
The QToolBar class provides a movable panel that contains a set of controls.
Definition: qtoolbar.h:62
QDockAreaLayoutInfo * info(const QList< int > &path)
bool layoutActions(const QSize &size)
QRegion separatorRegion() const
void clear()
Removes all items from the list.
Definition: qlist.h:764
void show()
Shows the widget and its child widgets.
bool animating() const
QWidgetAnimator widgetAnimator
QMainWindowLayoutState savedState

◆ applyState()

void QMainWindowLayout::applyState ( QMainWindowLayoutState newState,
bool  animate = true 
)

Definition at line 1912 of file qmainwindowlayout.cpp.

Referenced by hover(), and restoreState().

1913 {
1914 #ifndef QT_NO_DOCKWIDGET
1915 #ifndef QT_NO_TABBAR
1916  QSet<QTabBar*> used = newState.dockAreaLayout.usedTabBars();
1917  QSet<QTabBar*> retired = usedTabBars - used;
1918  usedTabBars = used;
1919  foreach (QTabBar *tab_bar, retired) {
1920  tab_bar->hide();
1921  while (tab_bar->count() > 0)
1922  tab_bar->removeTab(0);
1923  unusedTabBars.append(tab_bar);
1924  }
1925 
1926  if (sep == 1) {
1927  QSet<QWidget*> usedSeps = newState.dockAreaLayout.usedSeparatorWidgets();
1928  QSet<QWidget*> retiredSeps = usedSeparatorWidgets - usedSeps;
1929  usedSeparatorWidgets = usedSeps;
1930  foreach (QWidget *sepWidget, retiredSeps) {
1931  unusedSeparatorWidgets.append(sepWidget);
1932  }
1933  }
1934 
1935 
1936 #endif // QT_NO_TABBAR
1937 #endif // QT_NO_DOCKWIDGET
1938  newState.apply(dockOptions & QMainWindow::AnimatedDocks && animate);
1939 }
QSet< QTabBar * > usedTabBars() const
QSet< QTabBar * > usedTabBars
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
The QTabBar class provides a tab bar, e.g.
Definition: qtabbar.h:59
void removeTab(int index)
Removes the tab at position index.
Definition: qtabbar.cpp:902
void apply(bool animated)
QDockAreaLayout dockAreaLayout
QSet< QWidget * > usedSeparatorWidgets() const
QMainWindow::DockOptions dockOptions
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QSet< QWidget * > usedSeparatorWidgets
void hide()
Hides the widget.
Definition: qwidget.h:501
int count
the number of tabs in the tab bar
Definition: qtabbar.h:66
QList< QWidget * > unusedSeparatorWidgets
QList< QTabBar * > unusedTabBars

◆ centralWidget()

QWidget * QMainWindowLayout::centralWidget ( ) const

Definition at line 1775 of file qmainwindowlayout.cpp.

1776 {
1777  return layoutState.centralWidget();
1778 }
QMainWindowLayoutState layoutState
QWidget * centralWidget() const

◆ cleanUpMacToolbarItems()

void QMainWindowLayout::cleanUpMacToolbarItems ( )

Definition at line 538 of file qmainwindowlayout_mac.mm.

Referenced by ~QMainWindowLayout().

539 {
540 #ifdef QT_MAC_USE_COCOA
542 #endif
543  for (int i = 0; i < toolbarItemsCopy.size(); ++i) {
544 #ifdef QT_MAC_USE_COCOA
545  NSToolbarItem *item = static_cast<NSToolbarItem *>(toolbarItemsCopy.at(i));
546  [item setView:0];
547 #endif
548  CFRelease(toolbarItemsCopy.at(i));
549  }
550  toolbarItemsCopy.clear();
551  unifiedToolbarHash.clear();
552 
553 #ifdef QT_MAC_USE_COCOA
555  NSToolbar *macToolbar = [window toolbar];
556  if (macToolbar) {
557  [[macToolbar delegate] release];
558  [macToolbar setDelegate:nil];
559  }
560 #endif
561 }
QMainWindowLayoutState layoutState
NSToolbar * toolbar
OSWindowRef qt_mac_window_for(const QWidget *)
Definition: qwidget_mac.mm:484
NSWindow * window
WindowRef OSWindowRef
QHash< void *, QToolBar * > unifiedToolbarHash
QList< void * > toolbarItemsCopy

◆ corner()

Qt::DockWidgetArea QMainWindowLayout::corner ( Qt::Corner  corner) const

Definition at line 1080 of file qmainwindowlayout.cpp.

1081 {
1083 }
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
Qt::DockWidgetArea corner(Qt::Corner corner) const
Qt::DockWidgetArea corners[4]

◆ count()

int QMainWindowLayout::count ( ) const
virtual

Must be implemented in subclasses to return the number of items in the layout.

See also
itemAt()

Implements QLayout.

Definition at line 1400 of file qmainwindowlayout.cpp.

1401 {
1402  qWarning("QMainWindowLayout::count: ?");
1403  return 0; //#################################################
1404 }
Q_CORE_EXPORT void qWarning(const char *,...)

◆ createQToolBarInHIToolbarItem()

HIToolbarItemRef QMainWindowLayout::createQToolBarInHIToolbarItem ( QToolBar toolbar,
QMainWindowLayout layout 
)
staticprivate

Definition at line 195 of file qmainwindowlayout_mac.mm.

197 {
199 
200  EventRef event;
201  HIToolbarItemRef result = 0;
202 
204  UInt32 options = kHIToolbarItemAllowDuplicates;
205 
206  CreateEvent(0, kEventClassHIObject, kEventHIObjectInitialize,
207  GetCurrentEventTime(), 0, &event);
208  SetEventParameter(event, kEventParamToolbarItemIdentifier, typeCFStringRef,
209  sizeof(CFStringRef), &identifier);
210  SetEventParameter(event, kEventParamAttributes, typeUInt32, sizeof(UInt32), &options);
211  SetEventParameter(event, kEventParamQToolBar, typeVoidPtr, sizeof(void *), &toolbar);
212  SetEventParameter(event, kEventParamQMainWindowLayout, typeVoidPtr, sizeof(void *), &layout);
213 
214  HIObjectCreate(kQToolBarHIToolbarItemClassID, event,
215  static_cast<HIObjectRef *>(&result));
216 
217  ReleaseEvent(event);
218  return result;
219 
220 }
const struct __CFString * CFStringRef
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
static CFStringRef kQToolBarHIToolbarItemClassID
static void qtMacHIToolbarRegisterQToolBarInHIToolborItemClass()
struct OpaqueEventRef * EventRef
HIObjectRef HIToolbarItemRef
static const int kEventParamQToolBar
static const int kEventParamQMainWindowLayout
static CFStringRef kQToolBarHIToolbarIdentifier

◆ CreateToolbarItemForIdentifier()

HIToolbarItemRef QMainWindowLayout::CreateToolbarItemForIdentifier ( CFStringRef  identifier,
CFTypeRef  data 
)
staticprivate

Definition at line 222 of file qmainwindowlayout_mac.mm.

224 {
225  HIToolbarItemRef item = 0;
226  if (CFStringCompare(kQToolBarHIToolbarIdentifier, identifier,
227  kCFCompareBackwards) == kCFCompareEqualTo) {
228  if (data && CFGetTypeID(data) == CFArrayGetTypeID()) {
229  CFArrayRef array = static_cast<CFArrayRef>(data);
230  QToolBar *toolbar = static_cast<QToolBar *>(const_cast<void *>(CFArrayGetValueAtIndex(array, 0)));
231  QMainWindowLayout *layout = static_cast<QMainWindowLayout *>(const_cast<void *>(CFArrayGetValueAtIndex(array, 1)));
232  item = createQToolBarInHIToolbarItem(toolbar, layout);
233  }
234  }
235  return item;
236 }
NSToolbar * toolbar
The QToolBar class provides a movable panel that contains a set of controls.
Definition: qtoolbar.h:62
static HIToolbarItemRef createQToolBarInHIToolbarItem(QToolBar *toolbar, QMainWindowLayout *layout)
static const char * data(const QByteArray &arr)
HIObjectRef HIToolbarItemRef
QLayout * layout()
Reimplemented Function
const struct __CFArray * CFArrayRef
static CFStringRef kQToolBarHIToolbarIdentifier

◆ dockWidgetArea()

Qt::DockWidgetArea QMainWindowLayout::dockWidgetArea ( QDockWidget dockwidget) const

Definition at line 1255 of file qmainwindowlayout.cpp.

Referenced by QDockWidgetPrivate::setWindowState().

1256 {
1258  if (pathToWidget.isEmpty())
1259  return Qt::NoDockWidgetArea;
1260  return toDockWidgetArea(pathToWidget.first());
1261 }
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QList< int > indexOf(QWidget *dockWidget) const
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos)

◆ documentMode()

bool QMainWindowLayout::documentMode ( ) const

Definition at line 1120 of file qmainwindowlayout.cpp.

1121 {
1122  return _documentMode;
1123 }

◆ endSeparatorMove()

bool QMainWindowLayout::endSeparatorMove ( const QPoint pos)

Definition at line 1372 of file qmainwindowlayout.cpp.

1373 {
1374  if (movingSeparator.isEmpty())
1375  return false;
1377  savedState.clear();
1378  return true;
1379 }
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void clear()
Removes all items from the list.
Definition: qlist.h:764
QMainWindowLayoutState savedState
QList< int > movingSeparator

◆ fixSizeInUnifiedToolbar()

void QMainWindowLayout::fixSizeInUnifiedToolbar ( QToolBar tb) const

Definition at line 563 of file qmainwindowlayout_mac.mm.

Referenced by QToolBar::event(), and QToolBarLayout::setGeometry().

564 {
565 #ifdef QT_MAC_USE_COCOA
567  NSToolbarItem *item = nil;
568  while (it != unifiedToolbarHash.constEnd()) {
569  if (tb == it.value()) {
570  item = static_cast<NSToolbarItem *>(it.key());
571  break;
572  }
573  ++it;
574  }
575  if (item) {
577  QWidgetItem layoutItem(tb);
578  QSize size = layoutItem.maximumSize();
579  NSSize nssize = NSMakeSize(size.width(), size.height());
580  [item setMaxSize:nssize];
581  size = layoutItem.minimumSize();
582  nssize.width = size.width();
583  nssize.height = size.height();
584  [item setMinSize:nssize];
585  }
586 #else
587  Q_UNUSED(tb);
588 #endif
589 }
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
Definition: qhash.h:395
#define it(className, varName)
const Key & key() const
Returns the current item&#39;s key.
Definition: qhash.h:419
int width() const
Returns the width.
Definition: qsize.h:126
const T & value() const
Returns the current item&#39;s value.
Definition: qhash.h:420
The QWidgetItem class is a layout item that represents a widget.
Definition: qlayoutitem.h:122
QHash< void *, QToolBar * > unifiedToolbarHash
int height() const
Returns the height.
Definition: qsize.h:129
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ getSeparatorWidget()

QWidget * QMainWindowLayout::getSeparatorWidget ( )

Definition at line 1320 of file qmainwindowlayout.cpp.

Referenced by QDockAreaLayoutInfo::updateSeparatorWidgets(), and QDockAreaLayout::updateSeparatorWidgets().

1321 {
1322  QWidget *result = 0;
1324  result = unusedSeparatorWidgets.takeLast();
1325  } else {
1326  result = new QWidget(parentWidget());
1327  result->setAttribute(Qt::WA_MouseNoMask, true);
1328  result->setAutoFillBackground(false);
1329  result->setObjectName(QLatin1String("qt_qmainwindow_extended_splitter"));
1330  }
1331  usedSeparatorWidgets.insert(result);
1332  return result;
1333 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void setObjectName(const QString &name)
Definition: qobject.cpp:1112
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
const_iterator insert(const T &value)
Definition: qset.h:179
QSet< QWidget * > usedSeparatorWidgets
friend class QWidget
Definition: qlayout.h:207
void setAutoFillBackground(bool enabled)
Definition: qwidget.cpp:631
QList< QWidget * > unusedSeparatorWidgets
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
Definition: qwidget.cpp:11087
T takeLast()
Removes the last item in the list and returns it.
Definition: qlist.h:492

◆ getStyleOptionInfo()

void QMainWindowLayout::getStyleOptionInfo ( QStyleOptionToolBar option,
QToolBar toolBar 
) const

Definition at line 941 of file qmainwindowlayout.cpp.

Referenced by QToolBar::initStyleOption().

942 {
943  option->toolBarArea = toolBarArea(toolBar);
945 }
Qt::ToolBarArea toolBarArea(QToolBar *toolbar) const
QMainWindowLayoutState layoutState
void getStyleOptionInfo(QStyleOptionToolBar *option, QToolBar *toolBar) const
Qt::ToolBarArea toolBarArea
This variable holds the location for drawing the toolbar.
Definition: qstyleoption.h:379
QToolBarAreaLayout toolBarAreaLayout

◆ getTabBar()

QTabBar * QMainWindowLayout::getTabBar ( )

Definition at line 1302 of file qmainwindowlayout.cpp.

Referenced by QDockAreaLayoutInfo::updateTabBar().

1303 {
1304  QTabBar *result = 0;
1305  if (!unusedTabBars.isEmpty()) {
1306  result = unusedTabBars.takeLast();
1307  } else {
1308  result = new QMainWindowTabBar(parentWidget());
1309  result->setDrawBase(true);
1310  result->setElideMode(Qt::ElideRight);
1311  result->setDocumentMode(_documentMode);
1312  connect(result, SIGNAL(currentChanged(int)), this, SLOT(tabChanged()));
1313  }
1314 
1315  usedTabBars.insert(result);
1316  return result;
1317 }
void setDrawBase(bool drawTheBase)
Definition: qtabbar.cpp:800
QSet< QTabBar * > usedTabBars
#define SLOT(a)
Definition: qobjectdefs.h:226
The QTabBar class provides a tab bar, e.g.
Definition: qtabbar.h:59
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
#define SIGNAL(a)
Definition: qobjectdefs.h:227
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
void setDocumentMode(bool set)
Definition: qtabbar.cpp:2325
void setElideMode(Qt::TextElideMode)
Definition: qtabbar.cpp:2077
const_iterator insert(const T &value)
Definition: qset.h:179
QList< QTabBar * > unusedTabBars
T takeLast()
Removes the last item in the list and returns it.
Definition: qlist.h:492

◆ hover()

QList< int > QMainWindowLayout::hover ( QLayoutItem widgetItem,
const QPoint mousePos 
)

Definition at line 1840 of file qmainwindowlayout.cpp.

Referenced by QToolBarPrivate::mouseMoveEvent(), QDockWidgetPrivate::moveEvent(), and QDockWidgetPrivate::nonClientAreaMouseEvent().

1841 {
1842  if (!parentWidget()->isVisible() || parentWidget()->isMinimized()
1843  || pluggingWidget != 0 || widgetItem == 0)
1844  return QList<int>();
1845 
1846  QWidget *widget = widgetItem->widget();
1847  QPoint pos = parentWidget()->mapFromGlobal(mousePos);
1848 
1849  if (!savedState.isValid())
1851 
1852  QList<int> path = savedState.gapIndex(widget, pos);
1853 
1854  if (!path.isEmpty()) {
1855  bool allowed = false;
1856 
1857 #ifndef QT_NO_DOCKWIDGET
1858  if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget))
1859  allowed = dw->isAreaAllowed(toDockWidgetArea(path.at(1)));
1860 #endif
1861 #ifndef QT_NO_TOOLBAR
1862  if (QToolBar *tb = qobject_cast<QToolBar*>(widget))
1863  allowed = tb->isAreaAllowed(toToolBarArea(path.at(1)));
1864 #endif
1865 
1866  if (!allowed)
1867  path.clear();
1868  }
1869 
1870  if (path == currentGapPos)
1871  return currentGapPos; // the gap is already there
1872 
1873  currentGapPos = path;
1874  if (path.isEmpty()) {
1875  fixToolBarOrientation(widgetItem, 2); // 2 = top dock, ie. horizontal
1876  restore(true);
1877  return QList<int>();
1878  }
1879 
1880  fixToolBarOrientation(widgetItem, currentGapPos.at(1));
1881 
1883 
1884  if (!newState.insertGap(path, widgetItem)) {
1885  restore(true); // not enough space
1886  return QList<int>();
1887  }
1888 
1889  QSize min = newState.minimumSize();
1890  QSize size = newState.rect.size();
1891 
1892  if (min.width() > size.width() || min.height() > size.height()) {
1893  restore(true);
1894  return QList<int>();
1895  }
1896 
1897  newState.fitLayout();
1898 
1899  currentGapRect = newState.gapRect(currentGapPos);
1900 
1901 #ifndef QT_NO_DOCKWIDGET
1903 #endif
1904  layoutState = newState;
1906 
1908 
1909  return path;
1910 }
The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-l...
Definition: qdockwidget.h:60
QList< int > currentGapPos
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QList< int > gapIndex(QWidget *widget, const QPoint &pos) const
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
int width() const
Returns the width.
Definition: qsize.h:126
static void fixToolBarOrientation(QLayoutItem *item, int dockPos)
The QToolBar class provides a movable panel that contains a set of controls.
Definition: qtoolbar.h:62
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QRegion separatorRegion() const
void restore(bool keepSavedState=false)
void clear()
Removes all items from the list.
Definition: qlist.h:764
static Qt::ToolBarArea toToolBarArea(QInternal::DockPosition pos)
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
int height() const
Returns the height.
Definition: qsize.h:129
void applyState(QMainWindowLayoutState &newState, bool animate=true)
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
static Qt::DockWidgetArea toDockWidgetArea(QInternal::DockPosition pos)
QMainWindowLayoutState savedState

◆ insertIntoMacToolbar()

void QMainWindowLayout::insertIntoMacToolbar ( QToolBar before,
QToolBar after 
)

Definition at line 389 of file qmainwindowlayout_mac.mm.

390 {
391  // This layering could go on to one more level, but I decided to stop here.
392  // The HIToolbar and NSToolbar APIs are fairly similar as you will see.
393  if (toolbar == 0)
394  return;
395 
396 #if defined(QT_MAC_USE_COCOA)
397  // toolbar will now become native (if not already) since we need
398  // an nsview for it inside the corresponding NSToolbarItem.
399  // Setting isInUnifiedToolbar will (among other things) stop alien
400  // siblings from becoming native when this happends since the toolbar
401  // will not overlap with other children of the QMainWindow. NB: Switching
402  // unified toolbar off after this stage is not supported, as this means
403  // that either the menubar must be alien again, or the sibling must
404  // be backed by an nsview to protect from overlapping issues:
405  toolbar->d_func()->isInUnifiedToolbar = true;
406 #endif
407 
408  QToolBarLayout *toolbarLayout = static_cast<QToolBarLayout *>(toolbar->layout());
409  toolbarSaveState.insert(toolbar, ToolBarSaveState(toolbar->isMovable(), toolbar->maximumSize()));
410 
411  if (toolbarLayout->hasExpandFlag() == false)
412  toolbar->setMaximumSize(toolbar->sizeHint());
413 
414  toolbar->setMovable(false);
415  toolbarLayout->setUsePopupMenu(true);
416  // Make the toolbar a child of the mainwindow to avoid creating a window.
417  toolbar->setParent(layoutState.mainWindow);
418 
419  toolbar->winId(); // Now create the OSViewRef.
421 
423  int beforeIndex = qtoolbarsInUnifiedToolbarList.indexOf(before);
424  if (beforeIndex == -1)
425  beforeIndex = qtoolbarsInUnifiedToolbarList.size();
426 
427  int toolbarIndex = qtoolbarsInUnifiedToolbarList.indexOf(toolbar);
428 
429 #ifndef QT_MAC_USE_COCOA
430  HIToolbarRef macToolbar = NULL;
431  if ((GetWindowToolbar(window, &macToolbar) == noErr) && !macToolbar) {
432  HIToolbarCreate(kQMainWindowMacToolbarID,
433  kHIToolbarItemAllowDuplicates, &macToolbar);
434  InstallEventHandler(HIObjectGetEventTarget(static_cast<HIToolbarRef>(macToolbar)),
436  kToolbarEvents, this, 0);
437  HIToolbarSetDisplaySize(macToolbar, kHIToolbarDisplaySizeNormal);
438  HIToolbarSetDisplayMode(macToolbar, kHIToolbarDisplayModeIconOnly);
439  macWindowToolbarSet(window, macToolbar);
442  CFRelease(macToolbar);
443  }
444 #else
446  NSToolbar *macToolbar = [window toolbar];
447  if (macToolbar == nil) {
448  macToolbar = [[NSToolbar alloc] initWithIdentifier:qt_mac_QStringToNSString(QUuid::createUuid().toString())];
449  [macToolbar setDisplayMode:NSToolbarDisplayModeIconOnly];
450  [macToolbar setSizeMode:NSToolbarSizeModeRegular];
451  [macToolbar setDelegate:[[QT_MANGLE_NAMESPACE(QCocoaToolBarDelegate) alloc] initWithMainWindowLayout:this]];
452  [window setToolbar:macToolbar];
453  [macToolbar release];
454  }
455 #endif
456  if (toolbarIndex != -1) {
458 #ifndef QT_MAC_USE_COCOA
459  HIToolbarRemoveItemAtIndex(macToolbar, toolbarIndex);
460 #else
461  [macToolbar removeItemAtIndex:toolbarIndex];
462 #endif
463  }
465 
466  // Adding to the unified toolbar surface for the raster engine.
468  QPoint offset(0, 0);
469  for (int i = 0; i < beforeIndex; ++i) {
470  offset.setX(offset.x() + qtoolbarsInUnifiedToolbarList.at(i)->size().width());
471  }
472 #ifdef QT_MAC_USE_COCOA
473  unifiedSurface->insertToolbar(toolbar, offset);
474 #endif // QT_MAC_USE_COCOA
475  }
476 
477 #ifndef QT_MAC_USE_COCOA
479  const QObject *stupidArray[] = { toolbar, this };
480  QCFType<CFArrayRef> array = CFArrayCreate(0, reinterpret_cast<const void **>(&stupidArray),
481  2, 0);
482  HIToolbarCreateItemWithIdentifier(macToolbar, kQToolBarHIToolbarIdentifier,
483  array, &outItem);
484  HIToolbarInsertItemAtIndex(macToolbar, outItem, beforeIndex);
485 #else
486  NSString *toolbarID = kQToolBarNSToolbarIdentifier;
487  toolbarID = [toolbarID stringByAppendingFormat:@"%p", toolbar];
488  cocoaItemIDToToolbarHash.insert(qt_mac_NSStringToQString(toolbarID), toolbar);
489  [macToolbar insertItemWithItemIdentifier:toolbarID atIndex:beforeIndex];
490 #endif
491 }
static CFStringRef kQMainWindowMacToolbarID
QSize size() const
static QUuid createUuid()
On any platform other than Windows, this function returns a new UUID with variant QUuid::DCE and vers...
Definition: quuid.cpp:897
bool isVisible() const
Definition: qwidget.h:1005
void insert(int i, const T &t)
Inserts value at index position i in the list.
Definition: qlist.h:575
QMainWindowLayoutState layoutState
void macWindowToolbarSet(void *window, void *toolbarRef)
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
NSToolbar * toolbar
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
OSWindowRef qt_mac_window_for(const QWidget *)
Definition: qwidget_mac.mm:484
NSWindow * window
int width() const
Returns the width.
Definition: qsize.h:126
static QString toString(Register *reg, int type, bool *ok=0)
WindowRef OSWindowRef
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
QWindowSurface * windowSurface() const
Returns the QWindowSurface this widget will be drawn into.
Definition: qwidget.cpp:12819
static const EventTypeSpec kToolbarEvents[]
QHash< QToolBar *, ToolBarSaveState > toolbarSaveState
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
Definition: qlist.h:847
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
void setUsePopupMenu(bool set)
static OSStatus qtmacToolbarDelegate(EventHandlerCallRef, EventRef, void *)
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
QHash< QString, QToolBar * > cocoaItemIDToToolbarHash
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
void macWindowToolbarShow(const QWidget *widget, bool show)
void createWinId()
Definition: qwidget.cpp:2626
bool hasExpandFlag() const
static CFStringRef kQToolBarHIToolbarIdentifier
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480

◆ insertToolBar()

void QMainWindowLayout::insertToolBar ( QToolBar before,
QToolBar toolbar 
)

Adds toolbar before before.

Definition at line 892 of file qmainwindowlayout.cpp.

893 {
894 #ifdef Q_WS_MAC
895  if (usesHIToolBar(before)) {
896  insertIntoMacToolbar(before, toolbar);
897  } else
898 #endif // Q_WS_MAC
899  {
900  addChildWidget(toolbar);
901  QLayoutItem * item = layoutState.toolBarAreaLayout.insertToolBar(before, toolbar);
902  if (savedState.isValid() && item) {
903  // copy the toolbar also in the saved state
905  }
906  if (!currentGapPos.isEmpty() && currentGapPos.first() == 0) {
908  if (!currentGapPos.isEmpty()) {
911  }
912  }
913  invalidate();
914  }
915 }
QList< int > currentGapIndex() const
QLayoutItem * insertToolBar(QToolBar *before, QToolBar *toolBar)
QRect itemRect(const QList< int > &path) const
QList< int > currentGapPos
QMainWindowLayoutState layoutState
void insertIntoMacToolbar(QToolBar *before, QToolBar *after)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void invalidate()
Reimplemented Function
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
Definition: qlayout.cpp:1045
QToolBarAreaLayout toolBarAreaLayout
QMainWindowLayoutState savedState
bool usesHIToolBar(QToolBar *toolbar) const
void insertItem(QInternal::DockPosition pos, QLayoutItem *item)

◆ insertToolBarBreak()

void QMainWindowLayout::insertToolBarBreak ( QToolBar before)

Definition at line 815 of file qmainwindowlayout.cpp.

816 {
818  if (savedState.isValid())
820  invalidate();
821 }
void insertToolBarBreak(QToolBar *before)
QMainWindowLayoutState layoutState
void invalidate()
Reimplemented Function
QToolBarAreaLayout toolBarAreaLayout
QMainWindowLayoutState savedState

◆ invalidate()

void QMainWindowLayout::invalidate ( )
virtual

Reimplemented Function

Reimplemented from QLayout.

Definition at line 1517 of file qmainwindowlayout.cpp.

Referenced by setCentralWidget(), setDockOptions(), and setStatusBar().

1518 {
1520  minSize = szHint = QSize();
1521 }
void invalidate()
Reimplemented Function
Definition: qlayout.cpp:673
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ itemAt()

QLayoutItem * QMainWindowLayout::itemAt ( int  index) const
virtual

Must be implemented in subclasses to return the layout item at index.

If there is no such item, the function must return 0. Items are numbered consecutively from 0. If an item is deleted, other items will be renumbered.

This function can be used to iterate over a layout. The following code will draw a rectangle for each layout item in the layout structure of the widget.

static void paintLayout(QPainter *painter, QLayoutItem *item)
{
QLayout *layout = item->layout();
if (layout) {
for (int i = 0; i < layout->count(); ++i)
paintLayout(painter, layout->itemAt(i));
}
painter->drawRect(item->geometry());
}
void MyWidget::paintEvent(QPaintEvent *)
{
QPainter painter(this);
if (layout())
paintLayout(&painter, layout());
}
See also
count(), takeAt()

Implements QLayout.

Definition at line 1406 of file qmainwindowlayout.cpp.

1407 {
1408  int x = 0;
1409 
1410  if (QLayoutItem *ret = layoutState.itemAt(index, &x))
1411  return ret;
1412 
1413  if (statusbar && x++ == index)
1414  return statusbar;
1415 
1416  return 0;
1417 }
QLayoutItem * itemAt(int index, int *x) const
QMainWindowLayoutState layoutState
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64
quint16 index

◆ keepSize()

void QMainWindowLayout::keepSize ( QDockWidget w)

Definition at line 1263 of file qmainwindowlayout.cpp.

1264 {
1266 }
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
void keepSize(QDockWidget *w)

◆ minimumSize()

QSize QMainWindowLayout::minimumSize ( ) const
virtual

Returns the minimum size of this layout.

This is the smallest size that the layout can have while still respecting the specifications.

The returned value doesn't include the space required by QWidget::setContentsMargins() or menuBar().

The default implementation allows unlimited resizing.

Reimplemented from QLayout.

Definition at line 1498 of file qmainwindowlayout.cpp.

1499 {
1500  if (!minSize.isValid()) {
1502  const QSize sbMin = statusbar ? statusbar->minimumSize() : QSize(0, 0);
1503  minSize = QSize(qMax(sbMin.width(), minSize.width()),
1504  sbMin.height() + minSize.height());
1505 #ifdef Q_WS_MAC
1506  const QSize storedSize = minSize;
1507  int minWidth = 0;
1509  minWidth += toolbar->sizeHint().width() + 20;
1510  }
1511  minSize = QSize(qMax(minWidth, storedSize.width()), storedSize.height());
1512 #endif
1513  }
1514  return minSize;
1515 }
QMainWindowLayoutState layoutState
virtual QSize minimumSize() const =0
Implemented in subclasses to return the minimum size of this item.
NSToolbar * toolbar
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
virtual QSize sizeHint() const
int width() const
Returns the width.
Definition: qsize.h:126
The QToolBar class provides a movable panel that contains a set of controls.
Definition: qtoolbar.h:62
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
int height() const
Returns the height.
Definition: qsize.h:129
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
Definition: qsize.h:123
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ moveToolBar()

void QMainWindowLayout::moveToolBar ( QToolBar toolbar,
int  pos 
)

Definition at line 831 of file qmainwindowlayout.cpp.

Referenced by QToolBarPrivate::mouseMoveEvent().

832 {
834  if (savedState.isValid())
836  invalidate();
837 }
QMainWindowLayoutState layoutState
void invalidate()
Reimplemented Function
void moveToolBar(QToolBar *toolbar, int pos)
QToolBarAreaLayout toolBarAreaLayout
QMainWindowLayoutState savedState

◆ paintDropIndicator()

void QMainWindowLayout::paintDropIndicator ( QPainter p,
QWidget widget,
const QRegion clip 
)

◆ plug()

bool QMainWindowLayout::plug ( QLayoutItem widgetItem)

Definition at line 1575 of file qmainwindowlayout.cpp.

Referenced by QDockWidgetPrivate::endDrag(), and QToolBarPrivate::endDrag().

1576 {
1577  if (!parentWidget()->isVisible() || parentWidget()->isMinimized() || currentGapPos.isEmpty())
1578  return false;
1579 
1580  fixToolBarOrientation(widgetItem, currentGapPos.at(1));
1581 
1582  QWidget *widget = widgetItem->widget();
1583 
1584  QList<int> previousPath = layoutState.indexOf(widget);
1585 
1587  if (!it)
1588  return false;
1589  Q_ASSERT(it == widgetItem);
1590  if (!previousPath.isEmpty())
1591  layoutState.remove(previousPath);
1592 
1594  QRect globalRect = currentGapRect;
1595  globalRect.moveTopLeft(parentWidget()->mapToGlobal(globalRect.topLeft()));
1596 #ifndef QT_NO_DOCKWIDGET
1597  if (qobject_cast<QDockWidget*>(widget) != 0) {
1598  QDockWidgetLayout *layout = qobject_cast<QDockWidgetLayout*>(widget->layout());
1599  if (layout->nativeWindowDeco()) {
1600  globalRect.adjust(0, layout->titleHeight(), 0, 0);
1601  } else {
1602  int fw = widget->style()->pixelMetric(QStyle::PM_DockWidgetFrameWidth, 0, widget);
1603  globalRect.adjust(-fw, -fw, fw, fw);
1604  }
1605  }
1606 #endif
1608 
1609  return true;
1610 }
void remove(const QList< int > &path)
QLayoutItem * plug(const QList< int > &path)
#define it(className, varName)
QList< int > currentGapPos
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QMainWindowLayoutState layoutState
T * qobject_cast(QObject *object)
Definition: qobject.h:375
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
QMainWindow::DockOptions dockOptions
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64
static void fixToolBarOrientation(QLayoutItem *item, int dockPos)
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
Definition: qrect.h:434
int titleHeight() const
void moveTopLeft(const QPoint &p)
Moves the rectangle, leaving the top-left corner at the given position.
Definition: qrect.h:368
bool nativeWindowDeco() const
QList< int > indexOf(QWidget *widget) const
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
QWidgetAnimator widgetAnimator
QLayout * layout()
Reimplemented Function
void animate(QWidget *widget, const QRect &final_geometry, bool animate)
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ qtMacHIToolbarRegisterQToolBarInHIToolborItemClass()

void QMainWindowLayout::qtMacHIToolbarRegisterQToolBarInHIToolborItemClass ( )
staticprivate

Definition at line 178 of file qmainwindowlayout_mac.mm.

Referenced by createQToolBarInHIToolbarItem().

179 {
180  static bool registered = false;
181 
182  if (!registered) {
183  HIObjectRegisterSubclass( kQToolBarHIToolbarItemClassID,
184  kHIToolbarItemClassID, 0, QMainWindowLayout::qtoolbarInHIToolbarHandler,
185  GetEventTypeCount(qtoolbarEvents), qtoolbarEvents, 0, 0 );
186  registered = true;
187  }
188 }
const EventTypeSpec qtoolbarEvents[]
static CFStringRef kQToolBarHIToolbarItemClassID
static OSStatus qtoolbarInHIToolbarHandler(EventHandlerCallRef inCallRef, EventRef event, void *data)

◆ qtmacToolbarDelegate()

OSStatus QMainWindowLayout::qtmacToolbarDelegate ( EventHandlerCallRef  ,
EventRef  event,
void *  data 
)
staticprivate

Definition at line 246 of file qmainwindowlayout_mac.mm.

Referenced by insertIntoMacToolbar().

247 {
248  QMainWindowLayout *mainWindowLayout = static_cast<QMainWindowLayout *>(data);
249  OSStatus result = eventNotHandledErr;
250  CFMutableArrayRef array;
251  CFStringRef identifier;
252  switch (GetEventKind(event)) {
253  case kEventToolbarGetDefaultIdentifiers:
254  case kEventToolbarGetAllowedIdentifiers:
255  GetEventParameter(event, kEventParamMutableArray, typeCFMutableArrayRef, 0,
256  sizeof(CFMutableArrayRef), 0, &array);
257  GetToolbarAllowedItems(array);
258  result = noErr;
259  break;
260  case kEventToolbarCreateItemWithIdentifier: {
261  HIToolbarItemRef item;
262  CFTypeRef data = 0;
263  OSStatus err = GetEventParameter(event, kEventParamToolbarItemIdentifier, typeCFStringRef,
264  0, sizeof(CFStringRef), 0, &identifier);
265  err = GetEventParameter(event, kEventParamToolbarItemConfigData, typeCFTypeRef,
266  0, sizeof(CFTypeRef), 0, &data);
267  item = CreateToolbarItemForIdentifier(identifier, data);
268  if (item) {
269  result = SetEventParameter(event, kEventParamToolbarItem, typeHIToolbarItemRef,
270  sizeof(HIToolbarItemRef), &item );
271  }
272  break;
273  }
274  case kEventToolbarItemAdded: {
275  // Double check that our "view" of the toolbar is similar.
276  HIToolbarItemRef item;
277  CFIndex index;
278  if (GetEventParameter(event, kEventParamToolbarItem, typeHIToolbarItemRef,
279  0, sizeof(HIToolbarItemRef), 0, &item) == noErr
280  && GetEventParameter(event, kEventParamIndex, typeCFIndex, 0,
281  sizeof(CFIndex), 0, &index) == noErr) {
282  CFRetain(item); // We will watch this until it's removed from the list (or bust).
283  mainWindowLayout->toolbarItemsCopy.insert(index, item);
284  QToolBar *toolbar = mainWindowLayout->unifiedToolbarHash.value(item);
285  if (toolbar) {
286  int toolbarIndex = mainWindowLayout->qtoolbarsInUnifiedToolbarList.indexOf(toolbar);
287  if (index != toolbarIndex) {
288  // Dang, we must be out of sync, rebuild it from the "toolbarItemsCopy"
289  mainWindowLayout->qtoolbarsInUnifiedToolbarList.clear();
290  for (int i = 0; i < mainWindowLayout->toolbarItemsCopy.size(); ++i) {
291  // This will either append the correct toolbar or an
292  // null toolbar. This is fine because this list
293  // is really only kept to make sure that things are but in the right order.
294  mainWindowLayout->qtoolbarsInUnifiedToolbarList.append(
295  mainWindowLayout->unifiedToolbarHash.value(mainWindowLayout->
296  toolbarItemsCopy.at(i)));
297  }
298  }
299  }
300  }
301  break;
302  }
303  case kEventToolbarItemRemoved: {
304  HIToolbarItemRef item;
305  if (GetEventParameter(event, kEventParamToolbarItem, typeHIToolbarItemRef,
306  0, sizeof(HIToolbarItemRef), 0, &item) == noErr) {
307  mainWindowLayout->unifiedToolbarHash.remove(item);
308  for (int i = 0; i < mainWindowLayout->toolbarItemsCopy.size(); ++i) {
309  if (mainWindowLayout->toolbarItemsCopy.at(i) == item) {
310  // I know about it, so release it.
311  mainWindowLayout->toolbarItemsCopy.removeAt(i);
312  mainWindowLayout->qtoolbarsInUnifiedToolbarList.removeAt(i);
313  CFRelease(item);
314  break;
315  }
316  }
317  }
318  break;
319  }
320  }
321  return result;
322 }
const struct __CFString * CFStringRef
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
static HIToolbarItemRef CreateToolbarItemForIdentifier(CFStringRef identifier, CFTypeRef data)
NSToolbar * toolbar
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
The QToolBar class provides a movable panel that contains a set of controls.
Definition: qtoolbar.h:62
static const char * data(const QByteArray &arr)
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
void clear()
Removes all items from the list.
Definition: qlist.h:764
signed long OSStatus
const void * CFTypeRef
HIObjectRef HIToolbarItemRef
int indexOf(const T &t, int from=0) const
Returns the index position of the first occurrence of value in the list, searching forward from index...
Definition: qlist.h:847
QHash< void *, QToolBar * > unifiedToolbarHash
static void GetToolbarAllowedItems(CFMutableArrayRef array)
quint16 index
QList< void * > toolbarItemsCopy
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480

◆ qtoolbarInHIToolbarHandler()

OSStatus QMainWindowLayout::qtoolbarInHIToolbarHandler ( EventHandlerCallRef  inCallRef,
EventRef  event,
void *  data 
)
staticprivate

Definition at line 113 of file qmainwindowlayout_mac.mm.

Referenced by qtMacHIToolbarRegisterQToolBarInHIToolborItemClass().

115 {
116  OSStatus result = eventNotHandledErr;
117  QToolBarInHIToolbarInfo *object = static_cast<QToolBarInHIToolbarInfo *>(data);
118 
119  switch (GetEventClass(event)) {
120  case kEventClassHIObject:
121  switch (GetEventKind(event)) {
122  case kEventHIObjectConstruct:
123  {
124  HIObjectRef toolbarItem;
125  GetEventParameter(event, kEventParamHIObjectInstance, typeHIObjectRef,
126  0, sizeof( HIObjectRef ), 0, &toolbarItem);
127 
128  QToolBarInHIToolbarInfo *item = new QToolBarInHIToolbarInfo(toolbarItem);
129  SetEventParameter(event, kEventParamHIObjectInstance, typeVoidPtr,
130  sizeof(void *), &item);
131  result = noErr;
132  }
133  break;
134  case kEventHIObjectInitialize:
135  result = CallNextEventHandler(inCallRef, event);
136  if (result == noErr) {
137  QToolBar *toolbar = 0;
139  GetEventParameter(event, kEventParamQToolBar, typeVoidPtr,
140  0, sizeof(void *), 0, &toolbar);
141  GetEventParameter(event, kEventParamQMainWindowLayout, typeVoidPtr,
142  0, sizeof(void *), 0, &layout);
143  object->mainWindowLayout = layout;
144  object->mainWindowLayout->unifiedToolbarHash.insert(object->toolbarItem, toolbar);
145  HIToolbarItemChangeAttributes(object->toolbarItem,
146  kHIToolbarItemLabelDisabled, 0);
147  }
148  break;
149 
150  case kEventHIObjectDestruct:
151  delete object;
152  result = noErr;
153  break;
154  }
155  break;
156 
157  case kEventClassToolbarItem:
158  switch (GetEventKind(event))
159  {
160  case kEventToolbarItemCreateCustomView:
161  {
162  QToolBar *toolbar
163  = object->mainWindowLayout->unifiedToolbarHash.value(object->toolbarItem);
164  if (toolbar) {
165  HIViewRef hiview = HIViewRef(toolbar->winId());
166  SetEventParameter(event, kEventParamControlRef, typeControlRef,
167  sizeof(HIViewRef), &hiview);
168  result = noErr;
169  }
170  }
171  break;
172  }
173  break;
174  }
175  return result;
176 }
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
NSToolbar * toolbar
The QToolBar class provides a movable panel that contains a set of controls.
Definition: qtoolbar.h:62
struct OpaqueControlRef * HIViewRef
static const char * data(const QByteArray &arr)
signed long OSStatus
struct OpaqueHIObjectRef * HIObjectRef
static const int kEventParamQToolBar
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
static const int kEventParamQMainWindowLayout
QLayout * layout()
Reimplemented Function

◆ raise()

void QMainWindowLayout::raise ( QDockWidget widget)

Definition at line 1381 of file qmainwindowlayout.cpp.

1382 {
1384  if (info == 0)
1385  return;
1386 #ifndef QT_NO_TABBAR
1387  if (!info->tabbed)
1388  return;
1389  info->setCurrentTab(widget);
1390 #endif
1391 }
static mach_timebase_info_data_t info
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
void setCurrentTab(QWidget *widget)
QDockAreaLayoutInfo * info(const QList< int > &path)

◆ removeFromMacToolbar()

void QMainWindowLayout::removeFromMacToolbar ( QToolBar toolbar)

Definition at line 506 of file qmainwindowlayout_mac.mm.

507 {
509  while (it != unifiedToolbarHash.end()) {
510  if (it.value() == toolbar) {
511  // Rescue our HIView and set it on the mainWindow again.
512  bool saveVisible = !toolbar->isHidden();
513  toolbar->setParent(0);
514  toolbar->setParent(parentWidget());
515  toolbar->setVisible(saveVisible);
516  ToolBarSaveState saveState = toolbarSaveState.value(toolbar);
517  static_cast<QToolBarLayout *>(toolbar->layout())->setUsePopupMenu(false);
518  toolbar->setMovable(saveState.movable);
519  toolbar->setMaximumSize(saveState.maximumSize);
520  toolbarSaveState.remove(toolbar);
521 #ifndef QT_MAC_USE_COCOA
522  HIToolbarItemRef item = static_cast<HIToolbarItemRef>(it.key());
523  HIToolbarRemoveItemAtIndex(HIToolbarItemGetToolbar(item),
524  toolbarItemsCopy.indexOf(item));
525 #else
526  NSToolbarItem *item = static_cast<NSToolbarItem *>(it.key());
528  removeItemAtIndex:toolbarItemsCopy.indexOf(item)];
529  unifiedToolbarHash.remove(item);
531 #endif
532  break;
533  }
534  ++it;
535  }
536 }
void setParent(QWidget *parent)
Sets the parent of the widget to parent, and resets the window flags.
Definition: qwidget.cpp:10479
#define it(className, varName)
void setMaximumSize(const QSize &)
Definition: qwidget.h:972
QMainWindowLayoutState layoutState
T & value() const
Returns a modifiable reference to the current item&#39;s value.
Definition: qhash.h:348
void saveState(QDataStream &stream) const
NSToolbar * toolbar
OSWindowRef qt_mac_window_for(const QWidget *)
Definition: qwidget_mac.mm:484
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
const Key & key() const
Returns the current item&#39;s key as a const reference.
Definition: qhash.h:347
QHash< QToolBar *, ToolBarSaveState > toolbarSaveState
virtual void setVisible(bool visible)
Definition: qwidget.cpp:7991
HIObjectRef HIToolbarItemRef
QHash< void *, QToolBar * > unifiedToolbarHash
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
Definition: qhash.h:330
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
QLayout * layout() const
Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed...
Definition: qwidget.cpp:10073
void setMovable(bool movable)
Definition: qtoolbar.cpp:646
QList< void * > toolbarItemsCopy
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ removeToolBar()

void QMainWindowLayout::removeToolBar ( QToolBar toolbar)

Definition at line 841 of file qmainwindowlayout.cpp.

842 {
843  if (toolbar) {
844  QObject::disconnect(parentWidget(), SIGNAL(iconSizeChanged(QSize)),
845  toolbar, SLOT(_q_updateIconSize(QSize)));
846  QObject::disconnect(parentWidget(), SIGNAL(toolButtonStyleChanged(Qt::ToolButtonStyle)),
847  toolbar, SLOT(_q_updateToolButtonStyle(Qt::ToolButtonStyle)));
848 
849 #ifdef Q_WS_MAC
850  if (usesHIToolBar(toolbar)) {
851  removeFromMacToolbar(toolbar);
852  } else
853 #endif // Q_WS_MAC
854  {
855  removeWidget(toolbar);
856  }
857  }
858 }
#define SLOT(a)
Definition: qobjectdefs.h:226
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
#define SIGNAL(a)
Definition: qobjectdefs.h:227
void removeFromMacToolbar(QToolBar *toolbar)
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
Definition: qobject.cpp:2895
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
ToolButtonStyle
Definition: qnamespace.h:1572
bool usesHIToolBar(QToolBar *toolbar) const
void removeWidget(QWidget *w)
Removes the widget widget from the layout.
Definition: qlayout.cpp:1516

◆ removeToolBarBreak()

void QMainWindowLayout::removeToolBarBreak ( QToolBar before)

Definition at line 823 of file qmainwindowlayout.cpp.

824 {
826  if (savedState.isValid())
828  invalidate();
829 }
QMainWindowLayoutState layoutState
void invalidate()
Reimplemented Function
void removeToolBarBreak(QToolBar *before)
QToolBarAreaLayout toolBarAreaLayout
QMainWindowLayoutState savedState

◆ restore()

void QMainWindowLayout::restore ( bool  keepSavedState = false)

Definition at line 1672 of file qmainwindowlayout.cpp.

Referenced by QDockWidgetPrivate::endDrag(), QToolBarPrivate::endDrag(), hover(), and QDockWidgetPrivate::startDrag().

1673 {
1674  if (!savedState.isValid())
1675  return;
1676 
1679  if (!keepSavedState)
1680  savedState.clear();
1681  currentGapPos.clear();
1682  pluggingWidget = 0;
1684 }
QList< int > currentGapPos
QMainWindowLayoutState layoutState
void clear()
Removes all items from the list.
Definition: qlist.h:764
void applyState(QMainWindowLayoutState &newState, bool animate=true)
QMainWindowLayoutState savedState

◆ restoreDockWidget()

bool QMainWindowLayout::restoreDockWidget ( QDockWidget dockwidget)

Definition at line 1109 of file qmainwindowlayout.cpp.

1110 {
1111  addChildWidget(dockwidget);
1112  if (!layoutState.dockAreaLayout.restoreDockWidget(dockwidget))
1113  return false;
1114  emit dockwidget->dockLocationChanged(dockWidgetArea(dockwidget));
1115  invalidate();
1116  return true;
1117 }
void dockLocationChanged(Qt::DockWidgetArea area)
This signal is emitted when the dock widget is moved to another dock area, or is moved to a different...
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
void invalidate()
Reimplemented Function
#define emit
Definition: qobjectdefs.h:76
bool restoreDockWidget(QDockWidget *dockWidget)
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
Definition: qlayout.cpp:1045
Qt::DockWidgetArea dockWidgetArea(QDockWidget *dockwidget) const

◆ restoreState()

bool QMainWindowLayout::restoreState ( QDataStream stream)

Definition at line 1946 of file qmainwindowlayout.cpp.

1947 {
1949  layoutState.clear();
1951 
1952  if (!layoutState.restoreState(stream, savedState)) {
1955  if (parentWidget()->isVisible())
1956  applyState(layoutState, false); // hides tabBars allocated by newState
1957  return false;
1958  }
1959 
1960  if (parentWidget()->isVisible()) {
1962  applyState(layoutState, false);
1963  }
1964 
1966  savedState.clear();
1967 
1968 #ifndef QT_NO_DOCKWIDGET
1969  if (parentWidget()->isVisible()) {
1970 #ifndef QT_NO_TABBAR
1971  foreach (QTabBar *tab_bar, usedTabBars)
1972  tab_bar->show();
1973 
1974 #endif
1975  }
1976 #endif // QT_NO_DOCKWIDGET
1977 
1978  return true;
1979 }
QSet< QTabBar * > usedTabBars
QMainWindowLayoutState layoutState
The QTabBar class provides a tab bar, e.g.
Definition: qtabbar.h:59
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
void show()
Shows the widget and its child widgets.
bool restoreState(QDataStream &stream, const QMainWindowLayoutState &oldState)
void applyState(QMainWindowLayoutState &newState, bool animate=true)
QMainWindowLayoutState savedState

◆ revert()

void QMainWindowLayout::revert ( QLayoutItem widgetItem)

Definition at line 1559 of file qmainwindowlayout.cpp.

Referenced by QDockWidgetPrivate::endDrag(), and QToolBarPrivate::endDrag().

1560 {
1561  if (!savedState.isValid())
1562  return;
1563 
1564  QWidget *widget = widgetItem->widget();
1566  currentGapPos = layoutState.indexOf(widget);
1567  fixToolBarOrientation(widgetItem, currentGapPos.at(1));
1571 
1572  plug(widgetItem);
1573 }
QRect itemRect(const QList< int > &path) const
QList< int > currentGapPos
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QMainWindowLayoutState layoutState
static void fixToolBarOrientation(QLayoutItem *item, int dockPos)
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
bool plug(QLayoutItem *widgetItem)
QList< int > indexOf(QWidget *widget) const
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
QMainWindowLayoutState savedState
QLayoutItem * unplug(const QList< int > &path, QMainWindowLayoutState *savedState=0)

◆ saveState()

void QMainWindowLayout::saveState ( QDataStream stream) const

Definition at line 1941 of file qmainwindowlayout.cpp.

1942 {
1943  layoutState.saveState(stream);
1944 }
QMainWindowLayoutState layoutState
void saveState(QDataStream &stream) const

◆ separatorMove()

bool QMainWindowLayout::separatorMove ( const QPoint pos)

Definition at line 1363 of file qmainwindowlayout.cpp.

1364 {
1365  if (movingSeparator.isEmpty())
1366  return false;
1367  movingSeparatorPos = pos;
1368  separatorMoveTimer.start(0, this);
1369  return true;
1370 }
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QBasicTimer separatorMoveTimer
void start(int msec, QObject *obj)
Starts (or restarts) the timer with a msec milliseconds timeout.
QList< int > movingSeparator

◆ setCentralWidget()

void QMainWindowLayout::setCentralWidget ( QWidget cw)

Definition at line 1780 of file qmainwindowlayout.cpp.

1781 {
1782  if (widget != 0)
1785  if (savedState.isValid()) {
1786 #ifndef QT_NO_DOCKWIDGET
1789 #else
1790  savedState.centralWidgetItem = layoutState.centralWidgetItem;
1791 #endif
1792  }
1793  invalidate();
1794 }
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
void setCentralWidget(QWidget *widget)
QLayoutItem * centralWidgetItem
void invalidate()
Reimplemented Function
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
Definition: qlayout.cpp:1045
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
QMainWindowLayoutState savedState

◆ setCorner()

void QMainWindowLayout::setCorner ( Qt::Corner  corner,
Qt::DockWidgetArea  area 
)

Definition at line 1070 of file qmainwindowlayout.cpp.

1071 {
1073  return;
1075  if (savedState.isValid())
1077  invalidate();
1078 }
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
void invalidate()
Reimplemented Function
Qt::DockWidgetArea corner(Qt::Corner corner) const
QMainWindowLayoutState savedState
Qt::DockWidgetArea corners[4]
static int area(const QSize &s)
Definition: qicon.cpp:155

◆ setDockOptions()

void QMainWindowLayout::setDockOptions ( QMainWindow::DockOptions  opts)

Definition at line 1747 of file qmainwindowlayout.cpp.

1748 {
1749  if (opts == dockOptions)
1750  return;
1751 
1752  dockOptions = opts;
1753 
1754 #ifndef QT_NO_DOCKWIDGET
1756 #endif
1757 
1758  invalidate();
1759 }
void invalidate()
Reimplemented Function
QMainWindow::DockOptions dockOptions
void setVerticalTabsEnabled(bool enabled)

◆ setDocumentMode()

void QMainWindowLayout::setDocumentMode ( bool  enabled)

Definition at line 1125 of file qmainwindowlayout.cpp.

1126 {
1127  if (_documentMode == enabled)
1128  return;
1129 
1131 
1132  // Update the document mode for all tab bars
1133  foreach (QTabBar *bar, usedTabBars)
1135  foreach (QTabBar *bar, unusedTabBars)
1137 }
QSet< QTabBar * > usedTabBars
The QTabBar class provides a tab bar, e.g.
Definition: qtabbar.h:59
void setDocumentMode(bool set)
Definition: qtabbar.cpp:2325
QList< QTabBar * > unusedTabBars
#define enabled

◆ setGeometry()

void QMainWindowLayout::setGeometry ( const QRect r)
virtual

Reimplemented Function

Reimplemented from QLayout.

Definition at line 1460 of file qmainwindowlayout.cpp.

1461 {
1462  if (savedState.isValid())
1463  return;
1464 
1465  QRect r = _r;
1466 
1468 
1469  if (statusbar) {
1470  QRect sbr(QPoint(0, 0),
1473  sbr.moveBottom(r.bottom());
1474  QRect vr = QStyle::visualRect(parentWidget()->layoutDirection(), _r, sbr);
1475  statusbar->setGeometry(vr);
1476  r.setBottom(sbr.top() - 1);
1477  }
1478 
1479  layoutState.rect = r;
1481  applyState(layoutState, false);
1482 }
void setBottom(int pos)
Sets the bottom edge of the rectangle to the given y coordinate.
Definition: qrect.h:267
QSize expandedTo(const QSize &) const
Returns a size holding the maximum width and height of this size and the given otherSize.
Definition: qsize.h:187
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
QMainWindowLayoutState layoutState
virtual void setGeometry(const QRect &)
Reimplemented Function
Definition: qlayout.cpp:655
virtual QSize minimumSize() const =0
Implemented in subclasses to return the minimum size of this item.
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
virtual void setGeometry(const QRect &)=0
Implemented in subclasses to set this item&#39;s geometry to r.
static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect)
Returns the given logicalRectangle converted to screen coordinates based on the specified direction...
Definition: qstyle.cpp:2087
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void applyState(QMainWindowLayoutState &newState, bool animate=true)
virtual int heightForWidth(int) const
Returns the preferred height for this layout item, given the width w.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QMainWindowLayoutState savedState

◆ setStatusBar()

void QMainWindowLayout::setStatusBar ( QStatusBar sb)

Definition at line 1765 of file qmainwindowlayout.cpp.

1766 {
1767  if (sb)
1768  addChildWidget(sb);
1769  delete statusbar;
1770  statusbar = sb ? new QWidgetItemV2(sb) : 0;
1771  invalidate();
1772 }
void invalidate()
Reimplemented Function
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
Definition: qlayout.cpp:1045

◆ setTabPosition()

void QMainWindowLayout::setTabPosition ( Qt::DockWidgetAreas  areas,
QTabWidget::TabPosition  tabPosition 
)

Definition at line 1175 of file qmainwindowlayout.cpp.

1176 {
1177  const Qt::DockWidgetArea dockWidgetAreas[] = {
1182  };
1183  const QInternal::DockPosition dockPositions[] = {
1188  };
1189 
1190  for (int i = 0; i < QInternal::DockCount; ++i)
1191  if (areas & dockWidgetAreas[i])
1192  tabPositions[dockPositions[i]] = tabPosition;
1193 
1195 }
QTabWidget::TabPosition tabPosition(Qt::DockWidgetArea area) const
QTabWidget::TabPosition tabPositions[4]
DockWidgetArea
Definition: qnamespace.h:1337

◆ setTabShape()

void QMainWindowLayout::setTabShape ( QTabWidget::TabShape  tabShape)

Definition at line 1160 of file qmainwindowlayout.cpp.

1161 {
1162  if (_tabShape == tabShape)
1163  return;
1164 
1165  _tabShape = tabShape;
1166 
1168 }
QTabWidget::TabShape tabShape() const
QTabWidget::TabShape _tabShape

◆ setVerticalTabsEnabled()

void QMainWindowLayout::setVerticalTabsEnabled ( bool  enabled)

Definition at line 1140 of file qmainwindowlayout.cpp.

Referenced by setDockOptions().

1141 {
1142 #ifdef QT_NO_TABBAR
1143  Q_UNUSED(enabled);
1144 #else
1146  return;
1147 
1149 
1151 #endif // QT_NO_TABBAR
1152 }
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
#define enabled

◆ sizeHint()

QSize QMainWindowLayout::sizeHint ( ) const
virtual

Implemented in subclasses to return the preferred size of this item.

Implements QLayoutItem.

Definition at line 1487 of file qmainwindowlayout.cpp.

1488 {
1489  if (!szHint.isValid()) {
1491  const QSize sbHint = statusbar ? statusbar->sizeHint() : QSize(0, 0);
1492  szHint = QSize(qMax(sbHint.width(), szHint.width()),
1493  sbHint.height() + szHint.height());
1494  }
1495  return szHint;
1496 }
QMainWindowLayoutState layoutState
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
int width() const
Returns the width.
Definition: qsize.h:126
virtual QSize sizeHint() const =0
Implemented in subclasses to return the preferred size of this item.
int height() const
Returns the height.
Definition: qsize.h:129
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
Definition: qsize.h:123
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ splitDockWidget()

void QMainWindowLayout::splitDockWidget ( QDockWidget after,
QDockWidget dockwidget,
Qt::Orientation  orientation 
)

Definition at line 1245 of file qmainwindowlayout.cpp.

1248 {
1249  addChildWidget(dockwidget);
1250  layoutState.dockAreaLayout.splitDockWidget(after, dockwidget, orientation);
1251  emit dockwidget->dockLocationChanged(dockWidgetArea(after));
1252  invalidate();
1253 }
void dockLocationChanged(Qt::DockWidgetArea area)
This signal is emitted when the dock widget is moved to another dock area, or is moved to a different...
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
void invalidate()
Reimplemented Function
#define emit
Definition: qobjectdefs.h:76
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
Definition: qlayout.cpp:1045
Qt::DockWidgetArea dockWidgetArea(QDockWidget *dockwidget) const
void splitDockWidget(QDockWidget *after, QDockWidget *dockWidget, Qt::Orientation orientation)

◆ startSeparatorMove()

bool QMainWindowLayout::startSeparatorMove ( const QPoint pos)

Definition at line 1350 of file qmainwindowlayout.cpp.

1351 {
1353 
1354  if (movingSeparator.isEmpty())
1355  return false;
1356 
1359 
1360  return true;
1361 }
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
QList< int > findSeparator(const QPoint &pos) const
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QMainWindowLayoutState savedState
QList< int > movingSeparator

◆ statusBar()

QStatusBar * QMainWindowLayout::statusBar ( ) const

Definition at line 1762 of file qmainwindowlayout.cpp.

1763 { return statusbar ? qobject_cast<QStatusBar *>(statusbar->widget()) : 0; }
T * qobject_cast(QObject *object)
Definition: qobject.h:375
The QStatusBar class provides a horizontal bar suitable for presenting status information.
Definition: qstatusbar.h:57
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.

◆ syncUnifiedToolbarVisibility()

void QMainWindowLayout::syncUnifiedToolbarVisibility ( )

Definition at line 591 of file qmainwindowlayout_mac.mm.

Referenced by QToolBar::event().

592 {
594  return;
595 
597  bool show = false;
598  const int ToolBarCount = qtoolbarsInUnifiedToolbarList.count();
599  for (int i = 0; i < ToolBarCount; ++i) {
601  show = true;
602  break;
603  }
604  }
606 }
bool isVisible() const
Definition: qwidget.h:1005
QMainWindowLayoutState layoutState
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
bool unifiedTitleAndToolBarOnMac
whether the window uses the unified title and toolbar look on Mac OS X
Definition: qmainwindow.h:83
void macWindowToolbarShow(const QWidget *widget, bool show)

◆ tabChanged

void QMainWindowLayout::tabChanged ( )
privateslot

Definition at line 1335 of file qmainwindowlayout.cpp.

1336 {
1337  QTabBar *tb = qobject_cast<QTabBar*>(sender());
1338  if (tb == 0)
1339  return;
1341  if (info == 0)
1342  return;
1343  info->apply(false);
1344 
1345  if (QWidget *w = centralWidget())
1346  w->raise();
1347 }
static mach_timebase_info_data_t info
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QMainWindowLayoutState layoutState
The QTabBar class provides a tab bar, e.g.
Definition: qtabbar.h:59
T * qobject_cast(QObject *object)
Definition: qobject.h:375
QDockAreaLayout dockAreaLayout
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
Definition: qobject.cpp:2327
void apply(bool animate)
QDockAreaLayoutInfo * info(const QList< int > &path)
QWidget * centralWidget() const

◆ tabifyDockWidget()

void QMainWindowLayout::tabifyDockWidget ( QDockWidget first,
QDockWidget second 
)

Definition at line 1101 of file qmainwindowlayout.cpp.

1102 {
1103  addChildWidget(second);
1105  emit second->dockLocationChanged(dockWidgetArea(first));
1106  invalidate();
1107 }
void dockLocationChanged(Qt::DockWidgetArea area)
This signal is emitted when the dock widget is moved to another dock area, or is moved to a different...
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
void invalidate()
Reimplemented Function
#define emit
Definition: qobjectdefs.h:76
void tabifyDockWidget(QDockWidget *first, QDockWidget *second)
void addChildWidget(QWidget *w)
This function is called from addWidget() functions in subclasses to add w as a managed widget of a la...
Definition: qlayout.cpp:1045
Qt::DockWidgetArea dockWidgetArea(QDockWidget *dockwidget) const

◆ tabPosition()

QTabWidget::TabPosition QMainWindowLayout::tabPosition ( Qt::DockWidgetArea  area) const

Definition at line 1170 of file qmainwindowlayout.cpp.

1171 {
1172  return tabPositions[toDockPos(area)];
1173 }
static QInternal::DockPosition toDockPos(Qt::ToolBarArea area)
QTabWidget::TabPosition tabPositions[4]
static int area(const QSize &s)
Definition: qicon.cpp:155

◆ tabShape()

QTabWidget::TabShape QMainWindowLayout::tabShape ( ) const

Definition at line 1155 of file qmainwindowlayout.cpp.

1156 {
1157  return _tabShape;
1158 }
QTabWidget::TabShape _tabShape

◆ takeAt()

QLayoutItem * QMainWindowLayout::takeAt ( int  index)
virtual

Must be implemented in subclasses to remove the layout item at index from the layout, and return the item.

If there is no such item, the function must do nothing and return 0. Items are numbered consecutively from 0. If an item is removed, other items will be renumbered.

The following code fragment shows a safe way to remove all items from a layout:

QLayoutItem *child;
while ((child = layout->takeAt(0)) != 0) {
...
delete child;
}
See also
itemAt(), count()

Implements QLayout.

Definition at line 1419 of file qmainwindowlayout.cpp.

1420 {
1421  int x = 0;
1422 
1423  if (QLayoutItem *ret = layoutState.takeAt(index, &x)) {
1424  // the widget might in fact have been destroyed by now
1425  if (QWidget *w = ret->widget()) {
1426  widgetAnimator.abort(w);
1427  if (w == pluggingWidget)
1428  pluggingWidget = 0;
1429  }
1430 
1431  if (savedState.isValid() ) {
1432  //we need to remove the item also from the saved state to prevent crash
1433  savedState.remove(ret);
1434  //Also, the item may be contained several times as a gap item.
1435  layoutState.remove(ret);
1436  }
1437 
1438 #ifndef QT_NO_TOOLBAR
1439  if (!currentGapPos.isEmpty() && currentGapPos.first() == 0) {
1441  if (!currentGapPos.isEmpty()) {
1444  }
1445  }
1446 #endif
1447 
1448  return ret;
1449  }
1450 
1451  if (statusbar && x++ == index) {
1452  QLayoutItem *ret = statusbar;
1453  statusbar = 0;
1454  return ret;
1455  }
1456 
1457  return 0;
1458 }
QList< int > currentGapIndex() const
void remove(const QList< int > &path)
QRect itemRect(const QList< int > &path) const
QList< int > currentGapPos
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QMainWindowLayoutState layoutState
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QLayoutItem * takeAt(int index, int *x)
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
void abort(QWidget *widget)
quint16 index
QWidgetAnimator widgetAnimator
QToolBarAreaLayout toolBarAreaLayout
QMainWindowLayoutState savedState

◆ timerEvent()

void QMainWindowLayout::timerEvent ( QTimerEvent event)
virtual

This event handler can be reimplemented in a subclass to receive timer events for the object.

QTimer provides a higher-level interface to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.

See also
startTimer(), killTimer(), event()

Reimplemented from QObject.

Definition at line 1997 of file qmainwindowlayout.cpp.

1998 {
1999 #ifndef QT_NO_DOCKWIDGET
2000  if (e->timerId() == separatorMoveTimer.timerId()) {
2001  //let's move the separators
2003  if (movingSeparator.isEmpty())
2004  return;
2006  return;
2007 
2008  //when moving the separator, we need to update the previous position
2010 
2015  }
2016 #endif
2018 }
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
Definition: qobject.cpp:1294
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
void update()
Updates the widget unless updates are disabled or the widget is hidden.
Definition: qwidget.cpp:10883
QRegion separatorRegion() const
void stop()
Stops the timer.
int separatorMove(const QList< int > &separator, const QPoint &origin, const QPoint &dest)
int timerId() const
Returns the timer&#39;s ID.
Definition: qbasictimer.h:63
QBasicTimer separatorMoveTimer
QMainWindowLayoutState savedState
QList< int > movingSeparator

◆ toggleToolBarsVisible()

void QMainWindowLayout::toggleToolBarsVisible ( )

Definition at line 947 of file qmainwindowlayout.cpp.

948 {
949  bool updateNonUnifiedParts = true;
950 #ifdef Q_WS_MAC
952  // If we hit this case, someone has pressed the "toolbar button" which will
953  // toggle the unified toolbar visibility, because that's what the user wants.
954  // We might be in a situation where someone has hidden all the toolbars
955  // beforehand (maybe in construction), but now they've hit this button and
956  // and are expecting the items to show. What do we do?
957  // 1) Check the visibility of all the toolbars, if one is visible, do nothing, this
958  // preserves what people would expect (these toolbars were visible when I clicked last time).
959  // 2) If NONE are visible, then show them all. Again, this preserves the user expectation
960  // of, "I want to see the toolbars." The user may get more toolbars than expected, but this
961  // is better seeing nothing.
962  // Don't worry about any of this if we are going invisible. This does mean we may get
963  // into issues when switching into and out of fullscreen mode, but this is probably minor.
964  // If we ever need to do hiding, that would have to be taken care of after the unified toolbar
965  // has finished hiding.
966  // People can of course handle the QEvent::ToolBarChange event themselves and do
967  // WHATEVER they want if they don't like what we are doing (though the unified toolbar
968  // will fire regardless).
969 
970  // Check if we REALLY need to update the geometry below. If we only have items in the
971  // unified toolbar, all the docks will be empty, so there's very little point
972  // in doing the geometry as Apple will do it (we also avoid flicker in Cocoa as well).
973  // FWIW, layoutState.toolBarAreaLayout.visible and the state of the unified toolbar
974  // visibility can get out of sync. I really don't think it's a big issue. It is kept
975  // to a minimum because we only change the visibility if we absolutely must.
976  // update the "non unified parts."
977  updateNonUnifiedParts = !layoutState.toolBarAreaLayout.isEmpty();
978 
979  // We get this function before the unified toolbar does its thing.
980  // So, the value will be opposite of what we expect.
982  if (goingVisible) {
983  const int ToolBarCount = qtoolbarsInUnifiedToolbarList.size();
984  bool needAllVisible = true;
985  for (int i = 0; i < ToolBarCount; ++i) {
987  needAllVisible = false;
988  break;
989  }
990  }
991  if (needAllVisible) {
992  QBoolBlocker blocker(blockVisiblityCheck); // Disable the visibilty check because
993  // the toggle has already happened.
994  for (int i = 0; i < ToolBarCount; ++i)
996  }
997  }
998  if (!updateNonUnifiedParts)
999  layoutState.toolBarAreaLayout.visible = goingVisible;
1000  }
1001 #endif
1002  if (updateNonUnifiedParts) {
1005  QPoint topLeft = parentWidget()->geometry().topLeft();
1006  QRect r = parentWidget()->geometry();
1008  r.moveTo(topLeft);
1009  parentWidget()->setGeometry(r);
1010  } else {
1011  update();
1012  }
1013  }
1014 }
QRect rectHint(const QRect &r) const
QMainWindowLayoutState layoutState
void moveTo(int x, int t)
Moves the rectangle, leaving the top-left corner at the given position (x, y).
Definition: qrect.h:334
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
bool macWindowToolbarIsVisible(void *window)
OSWindowRef qt_mac_window_for(const QWidget *)
Definition: qwidget_mac.mm:484
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
Definition: qlayout.cpp:616
void update()
Updates the layout for parentWidget().
Definition: qlayout.cpp:1225
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
virtual void setVisible(bool visible)
Definition: qwidget.cpp:7991
bool isMaximized() const
Definition: qwidget.cpp:3074
bool unifiedTitleAndToolBarOnMac
whether the window uses the unified title and toolbar look on Mac OS X
Definition: qmainwindow.h:83
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QToolBarAreaLayout toolBarAreaLayout
QRect geometry
the geometry of the widget relative to its parent and excluding the window frame
Definition: qwidget.h:158
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288

◆ toolBarArea()

Qt::ToolBarArea QMainWindowLayout::toolBarArea ( QToolBar toolbar) const

Definition at line 917 of file qmainwindowlayout.cpp.

Referenced by QRasterWindowSurface::setGeometry(), and usesHIToolBar().

918 {
920  switch (pos) {
925  default: break;
926  }
927 #ifdef Q_WS_MAC
928  if (pos == QInternal::DockCount) {
930  return Qt::TopToolBarArea;
931  }
932 #endif
933  return Qt::NoToolBarArea;
934 }
QMainWindowLayoutState layoutState
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
QInternal::DockPosition findToolBar(QToolBar *toolBar) const
QToolBarAreaLayout toolBarAreaLayout

◆ toolBarBreak()

bool QMainWindowLayout::toolBarBreak ( QToolBar toolBar) const

Definition at line 936 of file qmainwindowlayout.cpp.

937 {
939 }
QMainWindowLayoutState layoutState
bool toolBarBreak(QToolBar *toolBar) const
QToolBarAreaLayout toolBarAreaLayout

◆ unplug()

QLayoutItem * QMainWindowLayout::unplug ( QWidget widget)

Definition at line 1796 of file qmainwindowlayout.cpp.

Referenced by QDockWidgetPrivate::startDrag(), and QToolBarPrivate::startDrag().

1797 {
1798  QList<int> path = layoutState.indexOf(widget);
1799  if (path.isEmpty())
1800  return 0;
1801 
1802  QLayoutItem *item = layoutState.item(path);
1803  if (widget->isWindow())
1804  return item;
1805 
1806  QRect r = layoutState.itemRect(path);
1808 
1809 #ifndef QT_NO_DOCKWIDGET
1810  if (QDockWidget *dw = qobject_cast<QDockWidget*>(widget)) {
1811  dw->d_func()->unplug(r);
1812  }
1813 #endif
1814 #ifndef QT_NO_TOOLBAR
1815  if (QToolBar *tb = qobject_cast<QToolBar*>(widget)) {
1816  tb->d_func()->unplug(r);
1817  }
1818 #endif
1819 
1820 
1821  layoutState.unplug(path ,&savedState);
1823  currentGapPos = path;
1824  currentGapRect = r;
1826 
1828 
1829  return item;
1830 }
The QDockWidget class provides a widget that can be docked inside a QMainWindow or floated as a top-l...
Definition: qdockwidget.h:60
QRect itemRect(const QList< int > &path) const
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
QList< int > currentGapPos
QMainWindowLayoutState layoutState
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64
static void fixToolBarOrientation(QLayoutItem *item, int dockPos)
The QToolBar class provides a movable panel that contains a set of controls.
Definition: qtoolbar.h:62
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QLayoutItem * item(const QList< int > &path)
QList< int > indexOf(QWidget *widget) const
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QMainWindowLayoutState savedState
QLayoutItem * unplug(const QList< int > &path, QMainWindowLayoutState *savedState=0)

◆ updateGapIndicator()

void QMainWindowLayout::updateGapIndicator ( )

Definition at line 1832 of file qmainwindowlayout.cpp.

Referenced by hover(), and unplug().

1833 {
1834 #ifndef QT_NO_RUBBERBAND
1837 #endif
1838 }
QList< int > currentGapPos
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void setGeometry(const QRect &r)
Sets the geometry of the rubber band to rect, specified in the coordinate system of its parent widget...
QRubberBand * gapIndicator
virtual void setVisible(bool visible)
Definition: qwidget.cpp:7991
bool animating() const
QWidgetAnimator widgetAnimator

◆ updateHIToolBarStatus()

void QMainWindowLayout::updateHIToolBarStatus ( )

Definition at line 329 of file qmainwindowlayout_mac.mm.

Referenced by QWidgetPrivate::setModal_sys().

330 {
331  bool useMacToolbar = layoutState.mainWindow->unifiedTitleAndToolBarOnMac();
332 #ifndef QT_MAC_USE_COCOA
333  if (useMacToolbar) {
334  ChangeWindowAttributes(qt_mac_window_for(layoutState.mainWindow),
336  } else {
337  ChangeWindowAttributes(qt_mac_window_for(layoutState.mainWindow),
339  }
340 #endif
341 
342  layoutState.mainWindow->setUpdatesEnabled(false); // reduces a little bit of flicker, not all though
343 #if defined(QT_MAC_USE_COCOA)
345  NSView *cView = [qt_mac_window_for(layoutState.mainWindow) contentView];
346  if (useMacToolbar) {
347  [cView setPostsFrameChangedNotifications:YES];
348  [[NSNotificationCenter defaultCenter] addObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate]
349  selector: @selector(syncContentViewFrame:)
350  name: NSViewFrameDidChangeNotification
351  object: cView];
352  }
353 #endif
354  if (!useMacToolbar) {
356  // Move everything out of the HIToolbar into the main toolbar.
358  // Should shrink the list by one every time.
360 #if defined(QT_MAC_USE_COCOA)
361  unifiedSurface->removeToolbar(toolbar);
362 #endif
364  }
366  } else {
368  for (int i = 0; i < toolbars.size(); ++i) {
369  QToolBar *toolbar = toolbars.at(i);
370  if (toolBarArea(toolbar) == Qt::TopToolBarArea) {
371  // Do this here, because we are in an in-between state.
372  removeWidget(toolbar);
374  }
375  }
377  }
378 #if defined(QT_MAC_USE_COCOA)
379  if (!useMacToolbar) {
380  [cView setPostsFrameChangedNotifications:NO];
381  [[NSNotificationCenter defaultCenter] removeObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate]
382  name: NSViewFrameDidChangeNotification
383  object: cView];
384  }
385 #endif
387 }
Qt::ToolBarArea toolBarArea(QToolBar *toolbar) const
QMainWindowLayoutState layoutState
void macWindowToolbarSet(void *window, void *toolbarRef)
void setUpdatesEnabled(bool enable)
Definition: qwidget.cpp:7670
NSToolbar * toolbar
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
OSWindowRef qt_mac_window_for(const QWidget *)
Definition: qwidget_mac.mm:484
The QToolBar class provides a movable panel that contains a set of controls.
Definition: qtoolbar.h:62
const char * name
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
bool unifiedTitleAndToolBarOnMac
whether the window uses the unified title and toolbar look on Mac OS X
Definition: qmainwindow.h:83
void addToolBar(Qt::ToolBarArea area, QToolBar *toolbar)
Adds the toolbar into the specified area in this main window.
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
void macWindowToolbarShow(const QWidget *widget, bool show)
if(void) toggleToolbarShown
#define kWindowUnifiedTitleAndToolbarAttribute
QList< T > findChildren(const QString &aName=QString()) const
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
Definition: qobject.h:162
void removeWidget(QWidget *w)
Removes the widget widget from the layout.
Definition: qlayout.cpp:1516
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ updateTabBarShapes()

void QMainWindowLayout::updateTabBarShapes ( )
private

Definition at line 1213 of file qmainwindowlayout.cpp.

1214 {
1215 #ifndef QT_NO_TABWIDGET
1216  const QTabWidget::TabPosition vertical[] = {
1221  };
1222 #else
1223  const QTabBar::Shape vertical[] = {
1228  };
1229 #endif
1230 
1232 
1233  for (int i = 0; i < QInternal::DockCount; ++i) {
1234 #ifndef QT_NO_TABWIDGET
1235  QTabWidget::TabPosition pos = verticalTabsEnabled ? vertical[i] : tabPositions[i];
1237 #else
1239 #endif
1240  layout.docks[i].setTabBarShape(shape);
1241  }
1242 }
TabPosition
This enum type defines where QTabWidget draws the tab row:
Definition: qtabwidget.h:112
static QTabBar::Shape tabBarShapeFrom(QTabWidget::TabShape shape, QTabWidget::TabPosition position)
QMainWindowLayoutState layoutState
QDockAreaLayout dockAreaLayout
Shape
This enum type lists the built-in shapes supported by QTabBar.
Definition: qtabbar.h:81
void setTabBarShape(int shape)
QTabWidget::TabPosition tabPositions[4]
QDockAreaLayoutInfo docks[4]
QLayout * layout()
Reimplemented Function
QTabWidget::TabShape _tabShape

◆ usesHIToolBar()

bool QMainWindowLayout::usesHIToolBar ( QToolBar toolbar) const

Definition at line 1985 of file qmainwindowlayout.cpp.

1986 {
1987 #ifndef Q_WS_MAC
1988  Q_UNUSED(toolbar);
1989  return false;
1990 #else
1991  return qtoolbarsInUnifiedToolbarList.contains(toolbar)
1992  || ((toolBarArea(toolbar) == Qt::TopToolBarArea)
1994 #endif
1995 }
Qt::ToolBarArea toolBarArea(QToolBar *toolbar) const
QMainWindowLayoutState layoutState
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
QList< QToolBar * > qtoolbarsInUnifiedToolbarList
bool unifiedTitleAndToolBarOnMac
whether the window uses the unified title and toolbar look on Mac OS X
Definition: qmainwindow.h:83
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

Properties

◆ _documentMode

bool QMainWindowLayout::_documentMode

Definition at line 224 of file qmainwindowlayout_p.h.

◆ _tabShape

QTabWidget::TabShape QMainWindowLayout::_tabShape

Definition at line 240 of file qmainwindowlayout_p.h.

◆ activateUnifiedToolbarAfterFullScreen

bool QMainWindowLayout::activateUnifiedToolbarAfterFullScreen

◆ blockVisiblityCheck

bool QMainWindowLayout::blockVisiblityCheck

Definition at line 343 of file qmainwindowlayout_p.h.

◆ cocoaItemIDToToolbarHash

QHash<QString, QToolBar *> QMainWindowLayout::cocoaItemIDToToolbarHash

Definition at line 336 of file qmainwindowlayout_p.h.

◆ currentGapPos

QList<int> QMainWindowLayout::currentGapPos

Definition at line 286 of file qmainwindowlayout_p.h.

Referenced by hover(), unplug(), and updateGapIndicator().

◆ currentGapRect

QRect QMainWindowLayout::currentGapRect

Definition at line 287 of file qmainwindowlayout_p.h.

Referenced by hover(), unplug(), and updateGapIndicator().

◆ dockOptions

QMainWindow::DockOptions QMainWindowLayout::dockOptions

Definition at line 169 of file qmainwindowlayout_p.h.

Referenced by applyState(), and setDockOptions().

◆ gapIndicator

QRubberBand* QMainWindowLayout::gapIndicator

Definition at line 290 of file qmainwindowlayout_p.h.

Referenced by QMainWindowLayout(), and updateGapIndicator().

◆ layoutState

QMainWindowLayoutState QMainWindowLayout::layoutState

◆ minSize

QSize QMainWindowLayout::minSize
mutable

Definition at line 280 of file qmainwindowlayout_p.h.

◆ movingSeparator

QList<int> QMainWindowLayout::movingSeparator

Definition at line 251 of file qmainwindowlayout_p.h.

Referenced by timerEvent().

◆ movingSeparatorOrigin

QPoint QMainWindowLayout::movingSeparatorOrigin

Definition at line 252 of file qmainwindowlayout_p.h.

Referenced by timerEvent().

◆ movingSeparatorPos

QPoint QMainWindowLayout::movingSeparatorPos

Definition at line 252 of file qmainwindowlayout_p.h.

Referenced by timerEvent().

◆ pluggingWidget

QWidget* QMainWindowLayout::pluggingWidget

◆ qtoolbarsInUnifiedToolbarList

QList<QToolBar *> QMainWindowLayout::qtoolbarsInUnifiedToolbarList

◆ savedState

QMainWindowLayoutState QMainWindowLayout::savedState

Definition at line 164 of file qmainwindowlayout_p.h.

Referenced by hover(), restoreState(), setCentralWidget(), timerEvent(), and unplug().

◆ sep

int QMainWindowLayout::sep

Definition at line 236 of file qmainwindowlayout_p.h.

Referenced by applyState(), and QMainWindowLayout().

◆ separatorMoveTimer

QBasicTimer QMainWindowLayout::separatorMoveTimer

Definition at line 253 of file qmainwindowlayout_p.h.

Referenced by timerEvent().

◆ statusbar

QLayoutItem* QMainWindowLayout::statusbar

Definition at line 177 of file qmainwindowlayout_p.h.

Referenced by setStatusBar(), statusBar(), and ~QMainWindowLayout().

◆ szHint

QSize QMainWindowLayout::szHint
mutable

Definition at line 279 of file qmainwindowlayout_p.h.

◆ tabPositions

QTabWidget::TabPosition QMainWindowLayout::tabPositions[4]

Definition at line 239 of file qmainwindowlayout_p.h.

Referenced by QMainWindowLayout().

◆ toolbarItemsCopy

QList<void *> QMainWindowLayout::toolbarItemsCopy

Definition at line 333 of file qmainwindowlayout_p.h.

Referenced by qtmacToolbarDelegate().

◆ toolbarSaveState

QHash<QToolBar *, ToolBarSaveState> QMainWindowLayout::toolbarSaveState

Definition at line 335 of file qmainwindowlayout_p.h.

◆ unifiedToolbarHash

QHash<void *, QToolBar *> QMainWindowLayout::unifiedToolbarHash

Definition at line 334 of file qmainwindowlayout_p.h.

Referenced by qtmacToolbarDelegate().

◆ unusedSeparatorWidgets

QList<QWidget*> QMainWindowLayout::unusedSeparatorWidgets

Definition at line 235 of file qmainwindowlayout_p.h.

Referenced by applyState().

◆ unusedTabBars

QList<QTabBar*> QMainWindowLayout::unusedTabBars

Definition at line 230 of file qmainwindowlayout_p.h.

Referenced by applyState().

◆ usedSeparatorWidgets

QSet<QWidget*> QMainWindowLayout::usedSeparatorWidgets

Definition at line 234 of file qmainwindowlayout_p.h.

Referenced by applyState().

◆ usedTabBars

QSet<QTabBar*> QMainWindowLayout::usedTabBars

Definition at line 229 of file qmainwindowlayout_p.h.

Referenced by applyState(), and restoreState().

◆ verticalTabsEnabled

bool QMainWindowLayout::verticalTabsEnabled

Definition at line 231 of file qmainwindowlayout_p.h.

◆ widgetAnimator

QWidgetAnimator QMainWindowLayout::widgetAnimator

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