Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
pqDesktopServicesReaction Class Reference

pqDesktopServicesReaction can be used to open a file (or URL) using QDesktopServices. More...

#include <pqDesktopServicesReaction.h>

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

Public Member Functions

 pqDesktopServicesReaction (const QUrl &url, QAction *parent)
 
 ~pqDesktopServicesReaction () override
 
- 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 bool openUrl (const QUrl &url)
 Attempt to open a file (local or on the Web) using QDesktopServices. More...
 

Protected Member Functions

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

Additional Inherited Members

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

Detailed Description

pqDesktopServicesReaction can be used to open a file (or URL) using QDesktopServices.

e.g. if your application wants to launch a PDF viewer to open the application's User Guide, you can hookup a menu QAction to the pqDesktopServicesReaction. e.g.

QAction* action = ...
new pqDesktopServicesReaction(QUrl("file:///..../doc/UsersGuide.pdf"), action);

The URL is set as status tip on the parent action.

Definition at line 24 of file pqDesktopServicesReaction.h.

Constructor & Destructor Documentation

◆ pqDesktopServicesReaction()

pqDesktopServicesReaction::pqDesktopServicesReaction ( const QUrl &  url,
QAction *  parent 
)

◆ ~pqDesktopServicesReaction()

pqDesktopServicesReaction::~pqDesktopServicesReaction ( )
override

Member Function Documentation

◆ openUrl()

static bool pqDesktopServicesReaction::openUrl ( const QUrl &  url)
static

Attempt to open a file (local or on the Web) using QDesktopServices.

Returns false if failed to open for some reason, other returns true.

◆ onTriggered()

void pqDesktopServicesReaction::onTriggered ( )
inlineoverrideprotectedvirtual

Called when the action is triggered.

Reimplemented from pqReaction.

Definition at line 40 of file pqDesktopServicesReaction.h.


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