blob: 578c423419391c8062ec9a02be9c0eaf7d2386f7 (
plain)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
|
#ifndef ENV_METRICS_H
#define ENV_METRICS_H
#include <QString>
#include <vector>
namespace env
{
// information about a monitor
//
class Display
{
public:
Display(QString adapter, QString monitorDevice, bool primary);
// display name of the adapter running the monitor
//
const QString& adapter() const;
// internal device name of the monitor, this is not a display name
//
const QString& monitorDevice() const;
// whether this monitor is the primary
//
bool primary();
// resolution
//
int resX() const;
int resY() const;
// dpi
//
int dpi();
// refresh rate in hz
//
int refreshRate() const;
// string representation
//
QString toString() const;
private:
QString m_adapter;
QString m_monitorDevice;
bool m_primary;
int m_resX, m_resY;
int m_dpi;
int m_refreshRate;
void getSettings();
};
// holds various information about Windows metrics
//
class Metrics
{
public:
Metrics();
// list of displays on the system
//
const std::vector<Display>& displays() const;
// full resolution
//
QRect desktopGeometry() const;
private:
std::vector<Display> m_displays;
void getDisplays();
};
} // namespace env
#endif // ENV_METRICS_H
|