Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
260 andreas 1
/*
2
 * Copyright (C) 2023 by Andreas Theofilu <andreas@theosys.at>
3
 *
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
18
#ifndef TQTWAIT_H
19
#define TQTWAIT_H
20
 
21
#include <QDialog>
22
 
23
class QTimer;
24
 
25
namespace Ui
26
{
27
    class TQtWait;
28
}
29
 
30
class TQtWait : public QDialog
31
{
32
    Q_OBJECT
33
 
34
    public:
35
        TQtWait(QWidget *parent = nullptr);
36
        TQtWait(QWidget *parent = nullptr, const std::string& text = "");
37
        ~TQtWait();
38
 
39
        void setScaleFactor(double sf) { mScaleFactor = sf; }
40
        void doResize();
41
        void setText(const std::string& text);
42
        void start();
43
        void end();
44
 
45
    private slots:
46
        void onTimerEvent();
47
 
48
    private:
49
        int scale(int value);
50
        void startTimer();
51
        template <typename T>
52
        void scaleObject(T *obj);
53
 
54
        Ui::TQtWait *ui{nullptr};
55
 
56
        double mScaleFactor{0.0};
57
        std::string mText;
58
        int mPosition{0};
59
        bool mDir{false};
60
        QTimer *mTimer{nullptr};
61
};
62
 
63
#endif // TQTWAIT_H