Mercurial > hg > svgui
annotate widgets/ProgressDialog.h @ 1306:5db672d6de4f
Better rendering for widget cells
author | Chris Cannam |
---|---|
date | Mon, 25 Jun 2018 15:29:47 +0100 |
parents | 05d12869043e |
children | a18e78b9c78b |
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: |
dev@1268 | 28 ProgressDialog(QString message, |
dev@1268 | 29 bool cancellable, |
dev@1268 | 30 int timeBeforeShow = 0, |
dev@1268 | 31 QWidget *parent = 0, |
dev@1268 | 32 Qt::WindowModality modality = Qt::NonModal); |
Chris@378 | 33 virtual ~ProgressDialog(); |
Chris@378 | 34 |
Chris@410 | 35 virtual bool isDefinite() const; |
Chris@410 | 36 virtual void setDefinite(bool definite); |
Chris@410 | 37 |
Chris@410 | 38 virtual bool wasCancelled() const; |
Chris@410 | 39 |
Chris@378 | 40 signals: |
Chris@410 | 41 void showing(); |
Chris@378 | 42 void cancelled(); |
Chris@378 | 43 |
Chris@378 | 44 public slots: |
Chris@378 | 45 virtual void setMessage(QString text); |
Chris@378 | 46 virtual void setProgress(int percentage); |
Chris@378 | 47 |
Chris@378 | 48 protected slots: |
Chris@378 | 49 virtual void showTimerElapsed(); |
Chris@410 | 50 void canceled(); |
Chris@378 | 51 |
Chris@378 | 52 protected: |
Chris@378 | 53 QProgressDialog *m_dialog; |
Chris@378 | 54 QTimer *m_showTimer; |
Chris@378 | 55 bool m_timerElapsed; |
Chris@410 | 56 bool m_cancelled; |
Chris@378 | 57 }; |
Chris@378 | 58 |
Chris@378 | 59 #endif |