pqProgressWidget.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 pqProgressWidget_h
5 #define pqProgressWidget_h
6 
7 #include <QScopedPointer>
8 #include <QWidget>
9 
10 #include "pqWidgetsModule.h"
11 
12 class QToolButton;
13 class pqProgressWidgetLabel;
14 
32 class PQWIDGETS_EXPORT pqProgressWidget : public QWidget
33 {
34  Q_OBJECT;
35  typedef QWidget Superclass;
36  Q_PROPERTY(QString readyText READ readyText WRITE setReadyText)
37  Q_PROPERTY(QString busyText READ busyText WRITE setBusyText)
38 public:
39  pqProgressWidget(QWidget* parent = nullptr);
40  ~pqProgressWidget() override;
41 
45  QToolButton* getAbortButton() const { return this->AbortButton; }
46 
50  QToolButton* abortButton() const { return this->AbortButton; }
51 
53 
58  void setReadyText(const QString&);
59  const QString& readyText() const { return this->ReadyText; }
61 
63 
68  void setBusyText(const QString&);
69  const QString& busyText() const { return this->BusyText; }
71 
72 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
77  void setProgress(const QString& message, int value);
78 
84  void enableProgress(bool enabled);
85 
89  void enableAbort(bool enabled);
90 
91 Q_SIGNALS:
95  void abortPressed();
96 
97 protected:
98  pqProgressWidgetLabel* ProgressBar;
99  QToolButton* AbortButton;
100 
104  void updateUI();
105 
106 private:
107  Q_DISABLE_COPY(pqProgressWidget);
108  QString ReadyText;
109  QString BusyText;
110 };
111 
112 #endif
widget to show progress in a QStatusBar.
const QString & busyText() const
Set the text to use by default when the progress bar is enabled which typically corresponds to applic...
QToolButton * abortButton() const
Provides access to the abort button.
const QString & readyText() const
Set the text to use by default when the progress bar is not enabled which typically corresponds to ap...
#define PQWIDGETS_EXPORT
QToolButton * AbortButton
enabled
value
pqProgressWidgetLabel * ProgressBar