-
Notifications
You must be signed in to change notification settings - Fork 1
/
window.hpp
67 lines (51 loc) · 1.19 KB
/
window.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
#ifndef WINDOW_HPP
#define WINDOW_HPP
#include <memory>
#include "qtquick2applicationviewer.h"
namespace SMSDB {
class Window;
}
class SMSDB::Window : public QtQuick2ApplicationViewer
{
Q_OBJECT
protected:
template <typename _T>
struct Hasher
{
std::size_t operator()(const _T &t) const
{
return std::hash<unsigned char>()(static_cast<unsigned char>(t));
}
};
enum class DisplayRatio : unsigned char {
Horz_16_10,
Horz_16_9,
Horz_4_3,
Vert_10_16,
Vert_9_16,
Vert_3_4
};
private:
class Pimpl;
std::unique_ptr<Pimpl> m_pimpl;
public:
explicit Window(QWindow *parent = NULL,
Qt::WindowType flags = Qt::FramelessWindowHint);
virtual ~Window();
signals:
void signal_Shown();
void signal_Closed();
public:
Q_INVOKABLE double getScreenWidth() const;
Q_INVOKABLE double getScreenHeight() const;
public:
void SetQML(const QString &url);
DisplayRatio GetDisplayRatio();
public:
virtual void Show();
virtual void Close();
protected:
void keyPressEvent(QKeyEvent *e);
void resizeEvent(QResizeEvent *e);
};
#endif // WINDOW_HPP