pqHighlightablePushButton.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 pqHighlightablePushButton_h
5 #define pqHighlightablePushButton_h
6 
7 #include "pqWidgetsModule.h"
8 #include <QPushButton>
9 #include <QScopedPointer>
10 
15 class PQWIDGETS_EXPORT pqHighlightablePushButton : public QPushButton
16 {
17  Q_OBJECT
18  typedef QPushButton Superclass;
19 
20 public:
21  pqHighlightablePushButton(QWidget* parent = nullptr);
22  pqHighlightablePushButton(const QString& text, QWidget* parent = nullptr);
23  pqHighlightablePushButton(const QIcon& icon, const QString& text, QWidget* parent = nullptr);
24  ~pqHighlightablePushButton() override;
25 
26 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
30  void highlight(bool clear = false);
31  void clear() { this->highlight(true); }
32 
33 private:
34  Q_DISABLE_COPY(pqHighlightablePushButton)
35  class pqInternals;
36  const QScopedPointer<pqInternals> Internals;
37 };
38 
39 #endif
#define PQWIDGETS_EXPORT
pqHighlightablePushButton extents QPushButton to add support for highlighting the button...