Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pqSaveScreenshotReaction Class Reference

Reaction to save a screenshot. More...

#include <pqSaveScreenshotReaction.h>

Inheritance diagram for pqSaveScreenshotReaction:
Inheritance graph
[legend]
Collaboration diagram for pqSaveScreenshotReaction:
Collaboration graph
[legend]

Public Slots

void updateEnableState () override
 Updates the enabled state. More...
 

Public Member Functions

 pqSaveScreenshotReaction (QAction *parent, bool clipboardMode=false)
 Constructor. More...
 
- Public Member Functions inherited from pqReaction
 pqReaction (QAction *parent, Qt::ConnectionType type=Qt::AutoConnection)
 Constructor. More...
 
 ~pqReaction () override
 
QAction * parentAction () const
 Provides access to the parent action. More...
 

Static Public Member Functions

static void saveScreenshot (bool clipboardMode=false)
 Saves the screenshot. More...
 
static bool saveScreenshot (const QString &filename, const QSize &size, int quality, bool all_views=false)
 Save a screenshot given the filename and image properties. More...
 
static bool copyScreenshotToClipboard (const QSize &size, bool all_views=false)
 Copy a screenshot to the clipboard. More...
 
static vtkSmartPointer< vtkImageDatatakeScreenshot (const QSize &size, bool all_views=false)
 Take a screenshot of the active view or all the views at the given size and return it as a vtkImageData. More...
 
static QString promptFileName (vtkSMSaveScreenshotProxy *saveProxy, const QString &defaultExtension)
 Prompt user for filename using the various format proxies listed for the given proxy. More...
 

Protected Member Functions

void onTriggered () override
 Called when the action is triggered. More...
 

Protected Attributes

bool ClipboardMode
 
- Protected Attributes inherited from pqReaction
bool IsMaster
 

Additional Inherited Members

- Protected Slots inherited from pqReaction
virtual void updateEnableState ()
 
virtual void updateMasterEnableState (bool)
 

Detailed Description

Reaction to save a screenshot.

pqSaveScreenshotReaction can be connected to a QAction to prompt user and save screenshots or captures from views using the ("misc", "SaveScreenshot") proxy.

Definition at line 50 of file pqSaveScreenshotReaction.h.

Constructor & Destructor Documentation

◆ pqSaveScreenshotReaction()

pqSaveScreenshotReaction::pqSaveScreenshotReaction ( QAction *  parent,
bool  clipboardMode = false 
)

Constructor.

Parent cannot be NULL.

Member Function Documentation

◆ saveScreenshot() [1/2]

static void pqSaveScreenshotReaction::saveScreenshot ( bool  clipboardMode = false)
static

Saves the screenshot.

Note that this method is static. Applications can simply use this without having to create a reaction instance. If clipboardMode is true, no advanced options are requested and the screenshot is copied to the clipboard

◆ saveScreenshot() [2/2]

static bool pqSaveScreenshotReaction::saveScreenshot ( const QString &  filename,
const QSize &  size,
int  quality,
bool  all_views = false 
)
static

Save a screenshot given the filename and image properties.

This method is provided only for convenience. This doesn't expose any of the advanced options available to users when saving screenshots.

◆ copyScreenshotToClipboard()

static bool pqSaveScreenshotReaction::copyScreenshotToClipboard ( const QSize &  size,
bool  all_views = false 
)
static

Copy a screenshot to the clipboard.

◆ takeScreenshot()

static vtkSmartPointer<vtkImageData> pqSaveScreenshotReaction::takeScreenshot ( const QSize &  size,
bool  all_views = false 
)
static

Take a screenshot of the active view or all the views at the given size and return it as a vtkImageData.

◆ promptFileName()

static QString pqSaveScreenshotReaction::promptFileName ( vtkSMSaveScreenshotProxy saveProxy,
const QString &  defaultExtension 
)
static

Prompt user for filename using the various format proxies listed for the given proxy.

◆ updateEnableState

void pqSaveScreenshotReaction::updateEnableState ( )
overrideslot

Updates the enabled state.

Applications need not explicitly call this.

◆ onTriggered()

void pqSaveScreenshotReaction::onTriggered ( )
inlineoverrideprotectedvirtual

Called when the action is triggered.

Reimplemented from pqReaction.

Definition at line 107 of file pqSaveScreenshotReaction.h.

Member Data Documentation

◆ ClipboardMode

bool pqSaveScreenshotReaction::ClipboardMode
protected

Definition at line 109 of file pqSaveScreenshotReaction.h.


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