-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWrappers.hpp
67 lines (49 loc) · 1.58 KB
/
Wrappers.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//
// Created by liuqichen on 3/4/23.
//
#ifndef LUMID_WRAPPERS_HPP
#define LUMID_WRAPPERS_HPP
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QSlider>
#include <QTimer>
#include "PreferencesWindow.hpp"
// include leads to circular dependency
class MainWindow;
namespace Wrappers {
class BrightnessSlider : public QSlider {
public:
QTimer *m_Timer{};
BrightnessSlider() = default;
void setTimer(QTimer *timer, MainWindow *mainWindow);
};
class ShowAllAndFocusButton : public QPushButton {
public:
QTimer *m_Timer{};
ShowAllAndFocusButton() = default;
void setTimer(QTimer *timer, MainWindow *mainWindow);
};
class SlidersHBoxLayout : public QHBoxLayout {
public:
//[[nodiscard]] is an attribute specifier in C++ that indicates that a
// function's return value should not be ignored.
[[nodiscard]] QSize sizeHint() const override;
};
void restartTimerForSecs(QTimer *timer, int secs);
class SliderWithLabelsLayout : public QVBoxLayout {
public:
SliderWithLabelsLayout();
Wrappers::BrightnessSlider m_Slider;
QLabel m_BrightnessLabel;
QLabel m_DisplayNameLabel;
std::string displayBus;
};
} // namespace Wrappers
// When you create an object on the stack, it will be automatically
// destroyed when it goes out of scope. However, if the object is a
// member of another object (like in your case with m_Exit, m_Open, and
// m_Preferences being members of TrayMenu),it will be destroyed when
// the owning object (TrayMenu) is destroyed, and not when it goes out
// of scope.
#endif // LUMID_WRAPPERS_HPP