pqProgressWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqProgressWidget.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 =========================================================================*/
32 #ifndef pqProgressWidget_h
33 #define pqProgressWidget_h
34 
35 #include <QScopedPointer>
36 #include <QWidget>
37 
38 #include "pqWidgetsModule.h"
39 
40 class QToolButton;
41 class pqProgressWidgetLabel;
42 
60 class PQWIDGETS_EXPORT pqProgressWidget : public QWidget
61 {
62  Q_OBJECT;
63  typedef QWidget Superclass;
64  Q_PROPERTY(QString readyText READ readyText WRITE setReadyText)
65  Q_PROPERTY(QString busyText READ busyText WRITE setBusyText)
66 public:
67  pqProgressWidget(QWidget* parent = 0);
68  ~pqProgressWidget() override;
69 
73  QToolButton* getAbortButton() const { return this->AbortButton; }
74 
78  QToolButton* abortButton() const { return this->AbortButton; }
79 
81 
86  void setReadyText(const QString&);
87  const QString& readyText() const { return this->ReadyText; }
89 
91 
96  void setBusyText(const QString&);
97  const QString& busyText() const { return this->BusyText; }
99 
100 public Q_SLOTS:
105  void setProgress(const QString& message, int value);
106 
112  void enableProgress(bool enabled);
113 
117  void enableAbort(bool enabled);
118 
119 Q_SIGNALS:
123  void abortPressed();
124 
125 protected:
126  pqProgressWidgetLabel* ProgressBar;
127  QToolButton* AbortButton;
128 
132  void updateUI();
133 
134 private:
135  Q_DISABLE_COPY(pqProgressWidget);
136  QString ReadyText;
137  QString BusyText;
138 };
139 
140 #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