pqDesktopServicesReaction.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqDesktopServicesReaction_h
5 #define pqDesktopServicesReaction_h
6 
7 #include "pqReaction.h"
8 
9 #include <QUrl>
10 
25 {
26  Q_OBJECT
27  typedef pqReaction Superclass;
28 
29 public:
30  pqDesktopServicesReaction(const QUrl& url, QAction* parent);
31  ~pqDesktopServicesReaction() override;
32 
37  static bool openUrl(const QUrl& url);
38 
39 protected:
40  void onTriggered() override { pqDesktopServicesReaction::openUrl(this->URL); }
41 
42 private:
43  Q_DISABLE_COPY(pqDesktopServicesReaction)
44  QUrl URL;
45 };
46 
47 #endif
static bool openUrl(const QUrl &url)
Attempt to open a file (local or on the Web) using QDesktopServices.
void onTriggered() override
Called when the action is triggered.
#define PQAPPLICATIONCOMPONENTS_EXPORT
This is a superclass just to make it easier to collect all such reactions.
Definition: pqReaction.h:25
url
pqDesktopServicesReaction can be used to open a file (or URL) using QDesktopServices.