digiKam
dbusydlg.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2009-11-03
7  * Description : a busy dialog for digiKam
8  *
9  * Copyright (C) 2009-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DBUSY_DLG_H
25 #define DIGIKAM_DBUSY_DLG_H
26 
27 // Qt includes
28 
29 #include <QThread>
30 #include <QString>
31 #include <QProgressDialog>
32 
33 // Local includes
34 
35 #include "digikam_export.h"
36 
37 namespace Digikam
38 {
39 
40 class DIGIKAM_EXPORT DBusyThread : public QThread
41 {
42  Q_OBJECT
43 
44 public:
45 
46  explicit DBusyThread(QObject* const parent);
47  ~DBusyThread() override;
48 
49 Q_SIGNALS:
50 
52 
53 protected:
54 
56  void run() override {};
57 };
58 
59 // ----------------------------------------------------------------------------------
60 
61 class DIGIKAM_EXPORT DBusyDlg : public QProgressDialog
62 {
63  Q_OBJECT
64 
65 public:
66 
67  explicit DBusyDlg(const QString& txt, QWidget* const parent = nullptr);
68  ~DBusyDlg() override;
69 
70  void setBusyThread(DBusyThread* const thread);
71 
72 public Q_SLOTS:
73 
74  void slotComplete();
75 
76 private:
77 
78  class Private;
79  Private* const d;
80 };
81 
82 } // namespace Digikam
83 
84 #endif // DIGIKAM_DBUSY_DLG_H
Definition: dbusydlg.h:62
Definition: dbusydlg.h:41
void run() override
Reimplement this method with your code to run in a separate thread.
Definition: dbusydlg.h:56
Definition: datefolderview.cpp:43