builds and manages menu for preview modes More...
#include <pqPreviewMenuManager.h>
Inherits QObject.
Public Member Functions | |
pqPreviewMenuManager (QMenu *parent) | |
Constructor that fills up default set of resolutions with a predefined set. More... | |
pqPreviewMenuManager (const QStringList &defaultItems, QMenu *parent) | |
Customize the default actions. More... | |
~pqPreviewMenuManager () override | |
QMenu * | parentMenu () const |
Provides access to the parent menu. More... | |
void | lockResolution (int dx, int dy) |
Enter preview mode for the specified resolution. More... | |
void | unlock () |
Exit preview mode. More... | |
builds and manages menu for preview modes
pqPreviewMenuManager populates the menu passed to the constructor with actions to switch the application into preview mode were the user can more faithfully setup annotations and scalar bar before saving out screenshots or animation for a target resolution.
The generated menu has a bunch if standard pre-defined items. These can be customized by passing a QStringList to the constructor. Also a item to add custom resolutions is added, so that user can click to add custom resolutions. A set of 5 most recent custom resolutions is preserved across sessions.
pqPreviewMenuManager requires that your application uses pqTabbedMultiViewWidget which has been registered with pqApplicationCore singleton as a "MULTIVIEW_WIDGET" manager.
Definition at line 34 of file pqPreviewMenuManager.h.
pqPreviewMenuManager::pqPreviewMenuManager | ( | QMenu * | parent | ) |
Constructor that fills up default set of resolutions with a predefined set.
pqPreviewMenuManager::pqPreviewMenuManager | ( | const QStringList & | defaultItems, |
QMenu * | parent | ||
) |
Customize the default actions.
The defaultItems
must contain strings for the form "%d x %d (%s)" e.g. "1024 x 1024 (Label)" or "%d x %d" e.g. "1024
x 1024". Any other form will be ignored silently.
|
override |
QMenu* pqPreviewMenuManager::parentMenu | ( | ) | const |
Provides access to the parent menu.
Enter preview mode for the specified resolution.
It dx
or dy
is <= 1, then it's same as calling unlock()
.
void pqPreviewMenuManager::unlock | ( | ) |
Exit preview mode.