ToolWindowManager
Qt based tool window manager.
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
QAbstractToolWindowManagerArea Class Referenceabstract

The QAbstractToolWindowManagerArea class is the base class for widgets used by QToolWindowManager to display one or several tool windows in its layout or floating windows. More...

Inherits QWidget.

Public Member Functions

 QAbstractToolWindowManagerArea (QToolWindowManager *manager)
 
QToolWindowManagermanager () const
 
virtual QWidgetList toolWindows () const =0
 
virtual void activateToolWindow (QWidget *toolWindow)=0
 

Protected Member Functions

virtual void addToolWindows (const QWidgetList &toolWindows)=0
 
virtual void removeToolWindow (QWidget *toolWindow)=0
 
virtual QVariant saveState () const
 
virtual void restoreState (const QVariant &state)
 
void updateDragPosition ()
 
void startDrag (const QWidgetList &toolWindows)
 

Protected Attributes

QToolWindowManagerm_manager
 

Friends

class QToolWindowManager
 
class QToolWindowManagerPrivate
 

Detailed Description

The QAbstractToolWindowManagerArea class is the base class for widgets used by QToolWindowManager to display one or several tool windows in its layout or floating windows.

To customize appearance and behavior of areas, subclass QAbstractToolWindowManagerArea and implement its virtual functions. Also subclass QToolWindowManager and reimplement QToolWindowManager::createArea to return new object of created subclass.

A subclass of QAbstractToolWindowManagerArea should implement displaying one or multiple tool windows, ability to switch between them, drag one tool window or entire area out of its place using mouse.

QtWidgets

Since
5.4

Constructor & Destructor Documentation

QAbstractToolWindowManagerArea::QAbstractToolWindowManagerArea ( QToolWindowManager manager)
explicit

Creates new area for the manager.

Member Function Documentation

QAbstractToolWindowManagerArea::activateToolWindow ( QWidget *  toolWindow)
pure virtual

Implement this function to activate (show, raise) toolWindow in the area. toolWindow must be a member of the area.

QAbstractToolWindowManagerArea::addToolWindows ( const QWidgetList &  toolWindows)
protectedpure virtual

Implement this function to add toolWindows to the area. The area may become a parent of tool windows to display them. toolWindows should appear in the end of QAbstractToolWindowManagerArea::toolWindows list immediately after this action. However if the area implementation provides a way to change tool windows order and user has changed it, QAbstractToolWindowManagerArea::toolWindow order should change accordingly.

QToolWindowManager * QAbstractToolWindowManagerArea::manager ( ) const

Returns the manager for this area.

QAbstractToolWindowManagerArea::removeToolWindow ( QWidget *  toolWindow)
protectedpure virtual

Implement this function to remove toolWindow from the area. Ownership and visibility of toolWindow should not be changed, as it's a responsibility of the manager to adjust them.

void QAbstractToolWindowManagerArea::restoreState ( const QVariant &  state)
protectedvirtual

This virtual function should be reimplemented to restore state based on state data obtained earlier from QAbstractToolWindowManagerArea::saveState function. Default implementation does nothing.

QVariant QAbstractToolWindowManagerArea::saveState ( ) const
protectedvirtual

This virtual function should be reimplemented to return additional state data specific to this area, e.g. current tool window (if applicable). Default implementation returns invalid QVariant.

void QAbstractToolWindowManagerArea::startDrag ( const QWidgetList &  toolWindows)
protected

Call this function to notify the manager that a drag operation on toolWindows has begun. The manager will take control of this process and move toolWindows to new position when the drag operation ends successfully.

QAbstractToolWindowManagerArea::toolWindows ( ) const
pure virtual

Implement this function to return list of tool windows in this area in actual order.

void QAbstractToolWindowManagerArea::updateDragPosition ( )
protected

When user starts dragging tool windows from the area, it continues to receive mouse events even if the mouse pointer leaves its boundaries. Call this function on every mouse move or release event to update manager's state according to new mouse state.

TODO: we should try to implement this internally using event filters.