Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Properties | Friends | List of all members
pqMultiViewWidget Class Reference

pqMultiViewWidget is a widget that manages layout of multiple views. More...

#include <pqMultiViewWidget.h>

Inherits QWidget.

Public Slots

void reload ()
 This forces the pqMultiViewWidget to reload its layout from the vtkSMViewLayoutProxy instance. More...
 
void makeFrameActive ()
 In a tabbed setup, when pqMultiViewWidget becomes active, this method should be called to ensure that the first view/frame in this widget is indeed made active, as the user would expect. More...
 
void lockViewSize (const QSize &)
 Locks the maximum size for each view-frame to the given size. More...
 
void reset ()
 cleans up the layout. More...
 
void destroyAllViews ()
 destroys each of the views present in this layout. More...
 
void setDecorationsVisibility (bool)
 Set the visibility for frame decorations and splitter handles. More...
 
void showDecorations ()
 Set the visibility for frame decorations and splitter handles. More...
 
void hideDecorations ()
 Set the visibility for frame decorations and splitter handles. More...
 

Signals

void frameActivated ()
 fired when a frame in this widget becomes active. More...
 
void decorationsVisibilityChanged (bool visible)
 fired when the decorations visibility is changed (by calling setDecorationsVisible). More...
 

Public Member Functions

 pqMultiViewWidget (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags{})
 
 ~pqMultiViewWidget () override
 
void setLayoutManager (vtkSMViewLayoutProxy *)
 Get/Set the vtkSMViewLayoutProxy instance this widget is using as the layout manager. More...
 
vtkSMViewLayoutProxylayoutManager () const
 
bool decorationsVisibility () const
 Returns whether window decorations and splitter handles are visible. More...
 
QList< vtkSMViewProxy * > viewProxies () const
 Returns list of views assigned to frames in this widget. More...
 
bool isViewAssigned (pqView *) const
 Returns true if the view has been assigned to this layout. More...
 
bool togglePopout ()
 pqMultiViewWidget supports popout mode i.e. More...
 
QSize preview (const QSize &previewSize=QSize())
 Enter (or exit) preview mode. More...
 
pqViewFrameactiveFrame ()
 Return the active frame, if any, else nullptr. More...
 
int activeFrameLocation () const
 Returns the location of the active frame, if any, else -1. More...
 

Protected Slots

void standardButtonPressed (int)
 Slots called on different signals fired by the nested frames or splitters. More...
 
void makeActive (pqViewFrame *frame)
 Makes a frame active. More...
 
void markActive (pqView *view)
 Marks the frame corresponding to the view, if present in the widget, as active. More...
 
void markActive (pqViewFrame *frame)
 
void swapPositions (const QString &)
 swap frame positions. More...
 
void proxyRemoved (pqProxy *)
 when a view proxy is unregistered, we ensure that the frame is marked as empty. More...
 
void viewAdded (pqView *)
 called when a new view is added. More...
 
void resizeEvent (QResizeEvent *evt) override
 If in preview mode, we need to update the widget's constraints based on the current widget geometry. More...
 

Protected Member Functions

virtual pqViewFramenewFrame (vtkSMProxy *view)
 Called whenever a new frame needs to be created for a view. More...
 
bool eventFilter (QObject *caller, QEvent *evt) override
 Event filter callback to detect when a sub-frame becomes active, so that we can mark it as such. More...
 

Properties

bool decorationsVisibility
 

Friends

class pqInternals
 

Detailed Description

pqMultiViewWidget is a widget that manages layout of multiple views.

It works together with a vtkSMViewLayoutProxy instance to keep track of the layout for the views. It's acceptable to create multiple instances of pqMultiViewWidget in the same application.

See also
pqHierarchicalGridLayout, pqHierarchicalGridWidget

Definition at line 28 of file pqMultiViewWidget.h.

Constructor & Destructor Documentation

◆ pqMultiViewWidget()

pqMultiViewWidget::pqMultiViewWidget ( QWidget *  parent = nullptr,
Qt::WindowFlags  f = Qt::WindowFlags{} 
)

◆ ~pqMultiViewWidget()

pqMultiViewWidget::~pqMultiViewWidget ( )
override

Member Function Documentation

◆ setLayoutManager()

void pqMultiViewWidget::setLayoutManager ( vtkSMViewLayoutProxy )

Get/Set the vtkSMViewLayoutProxy instance this widget is using as the layout manager.

◆ layoutManager()

vtkSMViewLayoutProxy* pqMultiViewWidget::layoutManager ( ) const

◆ decorationsVisibility()

bool pqMultiViewWidget::decorationsVisibility ( ) const

Returns whether window decorations and splitter handles are visible.

◆ viewProxies()

QList<vtkSMViewProxy*> pqMultiViewWidget::viewProxies ( ) const

Returns list of views assigned to frames in this widget.

◆ isViewAssigned()

bool pqMultiViewWidget::isViewAssigned ( pqView ) const

Returns true if the view has been assigned to this layout.

◆ togglePopout()

bool pqMultiViewWidget::togglePopout ( )

pqMultiViewWidget supports popout mode i.e.

the views could be laid out in separate popup widget rather than simply placing them under this pqMultiViewWidget frame. Use this method to toggle that. Returns true if the view is popped out at the end of this call, false otherwise.

◆ preview()

QSize pqMultiViewWidget::preview ( const QSize &  previewSize = QSize())

Enter (or exit) preview mode.

Preview mode is a mode were various widget's decorations are hidden and the widget is locked to the specified size. If the widget's current size is less than the size specified, then the widget is locked to a size with similar aspect ratio as requested. Pass in invalid (or empty) size to exit preview mode.

Preview mode is preferred over toggleWidgetDecoration and lockViewSize and is mutually exclusive with either. Mixing them can have unintended consequences.

Returns
the size to which the widget was locked. When unlocked, this will be QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX). When entering preview mode this will same as requested previewSize or a smaller size preserving aspect ratio as much as possible.

◆ activeFrame()

pqViewFrame* pqMultiViewWidget::activeFrame ( )

Return the active frame, if any, else nullptr.

◆ activeFrameLocation()

int pqMultiViewWidget::activeFrameLocation ( ) const

Returns the location of the active frame, if any, else -1.

◆ frameActivated

void pqMultiViewWidget::frameActivated ( )
signal

fired when a frame in this widget becomes active.

◆ decorationsVisibilityChanged

void pqMultiViewWidget::decorationsVisibilityChanged ( bool  visible)
signal

fired when the decorations visibility is changed (by calling setDecorationsVisible).

◆ reload

void pqMultiViewWidget::reload ( )
slot

This forces the pqMultiViewWidget to reload its layout from the vtkSMViewLayoutProxy instance.

One does not need to call this method explicitly, it is called automatically when the layoutManager is modified.

◆ makeFrameActive

void pqMultiViewWidget::makeFrameActive ( )
slot

In a tabbed setup, when pqMultiViewWidget becomes active, this method should be called to ensure that the first view/frame in this widget is indeed made active, as the user would expect.

◆ setDecorationsVisibility

void pqMultiViewWidget::setDecorationsVisibility ( bool  )
slot

Set the visibility for frame decorations and splitter handles.

◆ showDecorations

void pqMultiViewWidget::showDecorations ( )
inlineslot

Set the visibility for frame decorations and splitter handles.

Definition at line 131 of file pqMultiViewWidget.h.

◆ hideDecorations

void pqMultiViewWidget::hideDecorations ( )
inlineslot

Set the visibility for frame decorations and splitter handles.

Definition at line 132 of file pqMultiViewWidget.h.

◆ lockViewSize

void pqMultiViewWidget::lockViewSize ( const QSize &  )
slot

Locks the maximum size for each view-frame to the given size.

Use empty QSize() instance to indicate no limits.

◆ reset

void pqMultiViewWidget::reset ( )
slot

cleans up the layout.

◆ destroyAllViews

void pqMultiViewWidget::destroyAllViews ( )
slot

destroys each of the views present in this layout.

Useful when user closes the frame expecting that all containing views are destroyed.

◆ standardButtonPressed

void pqMultiViewWidget::standardButtonPressed ( int  )
protectedslot

Slots called on different signals fired by the nested frames or splitters.

Note that these slots use this->sender(), hence these should not be called directly. These result in updating the layoutManager.

◆ makeActive

void pqMultiViewWidget::makeActive ( pqViewFrame frame)
protectedslot

Makes a frame active.

This also call pqActiveObjects::setActiveView() to make the corresponding view active.

◆ markActive [1/2]

void pqMultiViewWidget::markActive ( pqView view)
protectedslot

Marks the frame corresponding to the view, if present in the widget, as active.

Note that this method does not fire the activeChanged() signal.

◆ markActive [2/2]

void pqMultiViewWidget::markActive ( pqViewFrame frame)
protectedslot

◆ swapPositions

void pqMultiViewWidget::swapPositions ( const QString &  )
protectedslot

swap frame positions.

◆ proxyRemoved

void pqMultiViewWidget::proxyRemoved ( pqProxy )
protectedslot

when a view proxy is unregistered, we ensure that the frame is marked as empty.

◆ viewAdded

void pqMultiViewWidget::viewAdded ( pqView )
protectedslot

called when a new view is added.

we update the layout if the view added belongs to this layout.

◆ resizeEvent

void pqMultiViewWidget::resizeEvent ( QResizeEvent *  evt)
overrideprotectedslot

If in preview mode, we need to update the widget's constraints based on the current widget geometry.

We do that in this overridden method which is called when the geometry may have potentially changed.

◆ newFrame()

virtual pqViewFrame* pqMultiViewWidget::newFrame ( vtkSMProxy view)
protectedvirtual

Called whenever a new frame needs to be created for a view.

Note that view may be null, in which case a place-holder frame is expected. The caller takes over the ownership of the created frame and will delete/re-parent it as and when appropriate.

◆ eventFilter()

bool pqMultiViewWidget::eventFilter ( QObject *  caller,
QEvent *  evt 
)
overrideprotected

Event filter callback to detect when a sub-frame becomes active, so that we can mark it as such.

Friends And Related Function Documentation

◆ pqInternals

friend class pqInternals
friend

Definition at line 222 of file pqMultiViewWidget.h.

Property Documentation

◆ decorationsVisibility

bool pqMultiViewWidget::decorationsVisibility
readwrite

Definition at line 33 of file pqMultiViewWidget.h.


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