ProgressDialog.h
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2007-2008 QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #ifndef SV_PROGRESS_DIALOG_H
17 
18 #include "base/ProgressReporter.h"
19 
20 class QProgressDialog;
21 class QTimer;
22 
23 class ProgressDialog : public ProgressReporter
24 {
25  Q_OBJECT
26 
27 public:
28  ProgressDialog(QString message,
29  bool cancellable,
30  int timeBeforeShow = 0, /* milliseconds */
31  QWidget *parent = 0,
32  Qt::WindowModality modality = Qt::NonModal);
33  virtual ~ProgressDialog();
34 
35  bool isDefinite() const override;
36  void setDefinite(bool definite) override;
37 
38  bool wasCancelled() const override;
39 
40 signals:
41  void showing();
42  void cancelled();
43 
44 public slots:
45  void setMessage(QString text) override;
46  void setProgress(int percentage) override;
47 
48 protected slots:
49  virtual void showTimerElapsed();
50  void canceled();
51 
52 protected:
53  QProgressDialog *m_dialog;
54  QTimer *m_showTimer;
57 };
58 
59 #endif
void setDefinite(bool definite) override
bool isDefinite() const override
bool wasCancelled() const override
virtual void showTimerElapsed()
QProgressDialog * m_dialog
QTimer * m_showTimer
void setProgress(int percentage) override
ProgressDialog(QString message, bool cancellable, int timeBeforeShow=0, QWidget *parent=0, Qt::WindowModality modality=Qt::NonModal)
virtual ~ProgressDialog()
void setMessage(QString text) override