pqMultiViewWidget is a widget that manages layout of multiple views.
More...
#include <pqMultiViewWidget.h>
Inherits QWidget.
|
virtual pqViewFrame * | newFrame (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...
|
|
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.
◆ pqMultiViewWidget()
pqMultiViewWidget::pqMultiViewWidget |
( |
QWidget * |
parent = nullptr , |
|
|
Qt::WindowFlags |
f = Qt::WindowFlags{} |
|
) |
| |
◆ ~pqMultiViewWidget()
pqMultiViewWidget::~pqMultiViewWidget |
( |
| ) |
|
|
override |
◆ setLayoutManager()
◆ layoutManager()
◆ decorationsVisibility()
bool pqMultiViewWidget::decorationsVisibility |
( |
| ) |
const |
Returns whether window decorations and splitter handles are visible.
◆ viewProxies()
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()
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 |
◆ 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 |
◆ 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 |
◆ 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()
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.
◆ pqInternals
◆ decorationsVisibility
bool pqMultiViewWidget::decorationsVisibility |
|
readwrite |
The documentation for this class was generated from the following file: