Mercurial > hg > svgui
annotate widgets/ProgressDialog.h @ 932:37bb4b416c52 tonioni
Render direct to widget (necessary to avoid pixel doubling on OS/X)
| author | Chris Cannam |
|---|---|
| date | Wed, 25 Mar 2015 11:27:46 +0000 |
| parents | 33b7f5e54d60 |
| children | b68f3162b5a8 |
| rev | line source |
|---|---|
| Chris@378 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
| Chris@378 | 2 |
| Chris@378 | 3 /* |
| Chris@378 | 4 Sonic Visualiser |
| Chris@378 | 5 An audio file viewer and annotation editor. |
| Chris@378 | 6 Centre for Digital Music, Queen Mary, University of London. |
| Chris@378 | 7 This file copyright 2007-2008 QMUL. |
| Chris@378 | 8 |
| Chris@378 | 9 This program is free software; you can redistribute it and/or |
| Chris@378 | 10 modify it under the terms of the GNU General Public License as |
| Chris@378 | 11 published by the Free Software Foundation; either version 2 of the |
| Chris@378 | 12 License, or (at your option) any later version. See the file |
| Chris@378 | 13 COPYING included with this distribution for more information. |
| Chris@378 | 14 */ |
| Chris@378 | 15 |
| Chris@378 | 16 #ifndef _PROGRESS_DIALOG_H_ |
| Chris@378 | 17 |
| Chris@378 | 18 #include "base/ProgressReporter.h" |
| Chris@378 | 19 |
| Chris@378 | 20 class QProgressDialog; |
| Chris@378 | 21 class QTimer; |
| Chris@378 | 22 |
| Chris@378 | 23 class ProgressDialog : public ProgressReporter |
| Chris@378 | 24 { |
| Chris@378 | 25 Q_OBJECT |
| Chris@378 | 26 |
| Chris@378 | 27 public: |
| Chris@378 | 28 ProgressDialog(QString message, bool cancellable, |
| Chris@378 | 29 int timeBeforeShow = 0, QWidget *parent = 0); |
| Chris@378 | 30 virtual ~ProgressDialog(); |
| Chris@378 | 31 |
| Chris@410 | 32 virtual bool isDefinite() const; |
| Chris@410 | 33 virtual void setDefinite(bool definite); |
| Chris@410 | 34 |
| Chris@410 | 35 virtual bool wasCancelled() const; |
| Chris@410 | 36 |
| Chris@378 | 37 signals: |
| Chris@410 | 38 void showing(); |
| Chris@378 | 39 void cancelled(); |
| Chris@378 | 40 |
| Chris@378 | 41 public slots: |
| Chris@378 | 42 virtual void setMessage(QString text); |
| Chris@378 | 43 virtual void setProgress(int percentage); |
| Chris@378 | 44 |
| Chris@378 | 45 protected slots: |
| Chris@378 | 46 virtual void showTimerElapsed(); |
| Chris@410 | 47 void canceled(); |
| Chris@378 | 48 |
| Chris@378 | 49 protected: |
| Chris@378 | 50 QProgressDialog *m_dialog; |
| Chris@378 | 51 QTimer *m_showTimer; |
| Chris@378 | 52 bool m_timerElapsed; |
| Chris@410 | 53 bool m_cancelled; |
| Chris@378 | 54 }; |
| Chris@378 | 55 |
| Chris@378 | 56 #endif |
