Public Member Functions | List of all members
pqPreviewMenuManager Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ pqPreviewMenuManager() [1/2]

pqPreviewMenuManager::pqPreviewMenuManager ( QMenu *  parent)

Constructor that fills up default set of resolutions with a predefined set.

◆ pqPreviewMenuManager() [2/2]

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.

◆ ~pqPreviewMenuManager()

pqPreviewMenuManager::~pqPreviewMenuManager ( )
override

Member Function Documentation

◆ parentMenu()

QMenu* pqPreviewMenuManager::parentMenu ( ) const

Provides access to the parent menu.

◆ lockResolution()

void pqPreviewMenuManager::lockResolution ( int  dx,
int  dy 
)

Enter preview mode for the specified resolution.

It dx or dy is <= 1, then it's same as calling unlock().

◆ unlock()

void pqPreviewMenuManager::unlock ( )

Exit preview mode.


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