on xenial help sign in
make it a listview, update to latest api
7f5356bMichael Zanetti
qml/Stage/Spread/ScreensAndWorkspaces.qml+10−15
@@ -20,34 +20,31 @@ Item {
20
20
21 delegate: Item {
21 delegate: Item {
22 height: root.height - units.gu(6)
22 height: root.height - units.gu(6)
23− width: workspaces.implicitWidth
23+ width: workspaces.width
24
24
25−
25+ UbuntuShape {
26− Rectangle { anchors.fill: parent; color: "blue" }
27−
28− Rectangle {
29 id: header
26 id: header
30 anchors { left: parent.left; top: parent.top; right: parent.right }
27 anchors { left: parent.left; top: parent.top; right: parent.right }
31 height: units.gu(7)
28 height: units.gu(7)
32− color: "white"
29+ backgroundColor: "white"
33
30
34 Column {
31 Column {
35 anchors.fill: parent
32 anchors.fill: parent
36 anchors.margins: units.gu(1)
33 anchors.margins: units.gu(1)
37
34
38 Label {
35 Label {
39− text: model.name
36+ text: model.screen.name
40 color: "black"
37 color: "black"
41 }
38 }
42
39
43 Label {
40 Label {
44− text: model.outputType === Screens.LVDS ? "Built-in" : "Clone"
41+ text: model.screen.outputType === Screens.LVDS ? "Built-in" : "Clone"
45 color: "black"
42 color: "black"
46 fontSize: "x-small"
43 fontSize: "x-small"
47 }
44 }
48
45
49 Label {
46 Label {
50− text: model.geometry.width + "x" + model.geometry.height
47+ text: model.screen.physicalSize.width + "x" + model.screen.physicalSize.height
51 color: "black"
48 color: "black"
52 fontSize: "x-small"
49 fontSize: "x-small"
53 }
50 }
@@ -57,14 +54,12 @@ Item {
57
54
58 Workspaces {
55 Workspaces {
59 id: workspaces
56 id: workspaces
60− height: parent.height - header.height
57+ height: parent.height - header.height - units.gu(2)
58+ width: Math.min(implicitWidth, units.gu(80), root.width)
61 anchors.bottom: parent.bottom
59 anchors.bottom: parent.bottom
60+ screen: model.screen
61+ background: root.background
62 }
62 }
63−
64−// WorkspacePreview {
65−// height: root.height - units.gu(6)
66−// background: root.background
67−// }
68 }
63 }
69 }
64 }
70 }
65 }
qml/Stage/Spread/WorkspacePreview.qml+78−54
@@ -2,38 +2,62 @@ import QtQuick 2.4
2import Ubuntu.Components 1.3
2import Ubuntu.Components 1.3
3import Unity.Screens 0.1
3import Unity.Screens 0.1
4import Unity.Application 0.1
4import Unity.Application 0.1
5+import ".."
5import "../../Components"
6import "../../Components"
6
7
7−UbuntuShape {
8+Item {
8 id: previewSpace
9 id: previewSpace
9
10
10− // Set the height. this preview will then automatically adjust the width, keeping aspect ratio of the screen
11− width: model.geometry.width * previewScale * 4
12− color: "white"
13 property string background
11 property string background
12+ property int screenHeight
14
13
15− property int screenWidth: model.geometry.width
16− property int screenHeight: model.geometry.height
17 property real previewScale: previewSpace.height / previewSpace.screenHeight
14 property real previewScale: previewSpace.height / previewSpace.screenHeight
18
15
19−
16+ Wallpaper {
20− Rectangle {
17+ source: previewSpace.background
21 anchors.fill: parent
18 anchors.fill: parent
22− color: "blue"
23
19
24 Repeater {
20 Repeater {
25− id: workspaceRepeater
21+ id: topLevelSurfaceRepeater
26− model: 15
22+ model: visible ? topLevelSurfaceList : null
23+ delegate: Rectangle {
24+ width: surfaceItem.width
25+ height: surfaceItem.height + decorationHeight * previewScale
26+ x: model.window.position.x * previewScale
27+ y: (model.window.position.y - decorationHeight) * previewScale
28+ color: "blue"
29+ z: topLevelSurfaceRepeater.count - index
30+
31+ property int decorationHeight: units.gu(3)
32+
33+ WindowDecoration {
34+ width: surfaceItem.implicitWidth
35+ height: parent.decorationHeight
36+ transform: Scale {
37+ origin.x: 0
38+ origin.y: 0
39+ xScale: previewScale
40+ yScale: previewScale
41+ }
42+ title: model.window && model.window.surface ? model.window.surface.name : ""
43+ z: 3
44+ }
27
45
28− delegate: Item {
46+ MirSurfaceItem {
29− x: index * previewSpace.screenWidth * previewScale
47+ id: surfaceItem
30− height: previewSpace.screenHeight * previewScale
48+ y: parent.decorationHeight * previewScale
31− width: previewSpace.screenWidth * previewScale
49+ width: implicitWidth * previewScale
32− clip: true
50+ height: implicitHeight * previewScale
51+ surfaceWidth: -1
52+ surfaceHeight: -1
53+ onImplicitHeightChanged: print("item", surfaceItem, "height changed", implicitHeight)
54+ surface: model.window.surface
55+ }
56+ }
57+ }
33
58
34− Wallpaper {
59+ }
35− source: previewSpace.background
60+}
36− anchors.fill: parent
37
61
38 // Repeater {
62 // Repeater {
39 // id: topLevelSurfaceRepeater
63 // id: topLevelSurfaceRepeater
@@ -73,8 +97,8 @@ UbuntuShape {
73 // }
97 // }
74 // }
98 // }
75 // }
99 // }
76− }
100+// }
77− }
101+// }
78
102
79
103
80// MouseArea {
104// MouseArea {
@@ -148,36 +172,36 @@ UbuntuShape {
148// anchors.centerIn: parent
172// anchors.centerIn: parent
149// }
173// }
150// }
174// }
151− }
175+// }
152−
176+
153− FloatingFlickable {
177+// FloatingFlickable {
154− id: flickable
178+// id: flickable
155− anchors.fill: parent
179+// anchors.fill: parent
156− contentWidth: workspaceRepeater.count * previewSpace.screenWidth * previewScale
180+// contentWidth: workspaceRepeater.count * previewSpace.screenWidth * previewScale
157− property real progress: contentX / contentWidth
181+// property real progress: contentX / contentWidth
158− onContentXChanged: print("contentX:", contentX, "progress:", progress)
182+// onContentXChanged: print("contentX:", contentX, "progress:", progress)
159− }
183+// }
160−
184+
161− MouseArea {
185+// MouseArea {
162− anchors.fill: parent
186+// anchors.fill: parent
163− hoverEnabled: true
187+// hoverEnabled: true
164− property int scrollAreaWidth: width / 3
188+// property int scrollAreaWidth: width / 3
165−
189+
166− onMouseXChanged: {
190+// onMouseXChanged: {
167− var margins = flickable.width * 0.05;
191+// var margins = flickable.width * 0.05;
168−
192+
169− // do we need to scroll?
193+// // do we need to scroll?
170− if (mouseX < scrollAreaWidth + margins) {
194+// if (mouseX < scrollAreaWidth + margins) {
171− var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
195+// var progress = Math.min(1, (scrollAreaWidth + margins - mouseX) / (scrollAreaWidth - margins));
172− var contentX = (1 - progress) * (flickable.contentWidth - flickable.width)
196+// var contentX = (1 - progress) * (flickable.contentWidth - flickable.width)
173− flickable.contentX = Math.max(0, Math.min(flickable.contentX, contentX))
197+// flickable.contentX = Math.max(0, Math.min(flickable.contentX, contentX))
174− }
198+// }
175− if (mouseX > flickable.width - scrollAreaWidth) {
199+// if (mouseX > flickable.width - scrollAreaWidth) {
176− var progress = Math.min(1, (mouseX - (flickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
200+// var progress = Math.min(1, (mouseX - (flickable.width - scrollAreaWidth)) / (scrollAreaWidth - margins))
177− var contentX = progress * (flickable.contentWidth - flickable.width)
201+// var contentX = progress * (flickable.contentWidth - flickable.width)
178− flickable.contentX = Math.min(flickable.contentWidth - flickable.width, Math.max(flickable.contentX, contentX))
202+// flickable.contentX = Math.min(flickable.contentWidth - flickable.width, Math.max(flickable.contentX, contentX))
179− }
203+// }
180− }
204+// }
181− }
205+// }
182− }
206+// }
183−}
207+//}
qml/Stage/Spread/Workspaces.qml+11−7
@@ -1,11 +1,13 @@
1import QtQuick 2.4
1import QtQuick 2.4
2import Ubuntu.Components 1.3
2import Ubuntu.Components 1.3
3+import "MathUtils.js" as MathUtils
3
4
4Item {
5Item {
5 id: root
6 id: root
6 implicitWidth: listView.count * (height * 16/9)
7 implicitWidth: listView.count * (height * 16/9)
7
8
8 property var screen: null
9 property var screen: null
10+ property var background // TODO: should be stored in the workspace data
9
11
10 ListView {
12 ListView {
11 id: listView
13 id: listView
@@ -29,7 +31,7 @@ Item {
29 delegate: Item {
31 delegate: Item {
30 objectName: "delegate" + index
32 objectName: "delegate" + index
31 height: parent.height
33 height: parent.height
32− width: dndArea.draggedIndex == index ? units.gu(5) : listView.itemWidth
34+ width: /*dndArea.draggedIndex == index ? units.gu(5) : */listView.itemWidth
33 Behavior on width { UbuntuNumberAnimation {} }
35 Behavior on width { UbuntuNumberAnimation {} }
34
36
35 property int itemX: -listView.contentX - listView.leftMargin + index * (listView.itemWidth + listView.spacing)
37 property int itemX: -listView.contentX - listView.leftMargin + index * (listView.itemWidth + listView.spacing)
@@ -42,14 +44,14 @@ Item {
42 if (index == 0) {
44 if (index == 0) {
43 if (distanceFromLeft < 0) {
45 if (distanceFromLeft < 0) {
44 var progress = (distanceFromLeft + listView.foldingAreaWidth) / listView.foldingAreaWidth
46 var progress = (distanceFromLeft + listView.foldingAreaWidth) / listView.foldingAreaWidth
45− return linearAnimation(1, -1, 0, maxAngle, Math.max(-1, Math.min(1, progress)));
47+ return MathUtils.linearAnimation(1, -1, 0, maxAngle, Math.max(-1, Math.min(1, progress)));
46 }
48 }
47 return 0
49 return 0
48 }
50 }
49 if (index == listView.count - 1) {
51 if (index == listView.count - 1) {
50 if (distanceFromRight < 0) {
52 if (distanceFromRight < 0) {
51 var progress = (distanceFromRight + listView.foldingAreaWidth) / listView.foldingAreaWidth
53 var progress = (distanceFromRight + listView.foldingAreaWidth) / listView.foldingAreaWidth
52− return linearAnimation(1, -1, 0, -maxAngle, Math.max(-1, Math.min(1, progress)));
54+ return MathUtils.linearAnimation(1, -1, 0, -maxAngle, Math.max(-1, Math.min(1, progress)));
53 }
55 }
54 return 0
56 return 0
55 }
57 }
@@ -57,11 +59,11 @@ Item {
57 if (distanceFromLeft < listView.foldingAreaWidth) {
59 if (distanceFromLeft < listView.foldingAreaWidth) {
58 // itemX : 10gu = p : 100
60 // itemX : 10gu = p : 100
59 var progress = distanceFromLeft / listView.foldingAreaWidth
61 var progress = distanceFromLeft / listView.foldingAreaWidth
60− return linearAnimation(1, -1, 0, maxAngle, Math.max(-1, Math.min(1, progress)));
62+ return MathUtils.linearAnimation(1, -1, 0, maxAngle, Math.max(-1, Math.min(1, progress)));
61 }
63 }
62 if (distanceFromRight < listView.foldingAreaWidth) {
64 if (distanceFromRight < listView.foldingAreaWidth) {
63 var progress = distanceFromRight / listView.foldingAreaWidth
65 var progress = distanceFromRight / listView.foldingAreaWidth
64− return linearAnimation(1, -1, 0, -maxAngle, Math.max(-1, Math.min(1, progress)));
66+ return MathUtils.linearAnimation(1, -1, 0, -maxAngle, Math.max(-1, Math.min(1, progress)));
65 }
67 }
66 return 0
68 return 0
67 }
69 }
@@ -116,9 +118,11 @@ Item {
116 ]
118 ]
117
119
118 WorkspacePreview {
120 WorkspacePreview {
119−
121+ height: listView.height
122+ width: listView.itemWidth
123+ background: root.background
124+ screenHeight: screen.physicalSize.height
120 }
125 }
121−
122 }
126 }
123 }
127 }
124}
128}
qml/Stage/Stage.qml+1−1
@@ -346,7 +346,7 @@ FocusScope {
346 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
346 readonly property real virtualKeyboardHeight: root.inputMethodRect.height
347 }
347 }
348
348
349− Component.onCompleted: priv.updateMainAndSideStageIndexes();
349+ Component.onCompleted: {priv.updateMainAndSideStageIndexes(); print("size", root.width, root.height)}
350
350
351 Connections {
351 Connections {
352 target: panelState
352 target: panelState
tests/mocks/Unity/Screens/plugin.cpp+2
@@ -33,6 +33,8 @@ void UnityScreensPlugin::registerTypes(const char* uri)
33 Q_ASSERT(QLatin1String(uri) == QLatin1String("Unity.Screens"));
33 Q_ASSERT(QLatin1String(uri) == QLatin1String("Unity.Screens"));
34
34
35 qRegisterMetaType<QScreen*>("QScreen*");
35 qRegisterMetaType<QScreen*>("QScreen*");
36+ qRegisterMetaType<ScreenMode*>("ScreenMode*");
37+ qmlRegisterUncreatableType<ScreenMode>(uri, 0, 1, "ScreenMode", "ScreenMode is not creatable.");
36
38
37 qmlRegisterSingletonType<Screens>(uri, 0, 1, "Screens", screensSingleton);
39 qmlRegisterSingletonType<Screens>(uri, 0, 1, "Screens", screensSingleton);
38 qmlRegisterType<ScreenWindow>(uri, 0, 1, "ScreenWindow");
40 qmlRegisterType<ScreenWindow>(uri, 0, 1, "ScreenWindow");
tests/mocks/Unity/Screens/screens.cpp+39−42
@@ -18,11 +18,8 @@
18
18
19// Qt
19// Qt
20#include <QGuiApplication>
20#include <QGuiApplication>
21−#include <QScreen>
22#include <QDebug>
21#include <QDebug>
23
22
24−Q_DECLARE_METATYPE(QScreen*)
25−
26Screens::Screens(QObject *parent) :
23Screens::Screens(QObject *parent) :
27 QAbstractListModel(parent)
24 QAbstractListModel(parent)
28{
25{
@@ -32,18 +29,18 @@ Screens::Screens(QObject *parent) :
32 QPoint lastPoint(0,0);
29 QPoint lastPoint(0,0);
33 for (int i = 0; i < screenCount; ++i) {
30 for (int i = 0; i < screenCount; ++i) {
34 auto screen = new Screen();
31 auto screen = new Screen();
35− screen->enabled = i == 0;
32+ screen->m_active = i == 0;
36− if (i == 0) {
37− screen->outputTypes = OutputTypes::LVDS;
38− } else {
39− screen->outputTypes = OutputTypes::HDMIA;
40− }
41− screen->name = QString("Monitor %1").arg(i);
33+ screen->m_name = QString("Monitor %1").arg(i);
42− screen->sizes = { QSize(640,480), QSize(1024,748), QSize(1280,1024), QSize(1440,900), QSize(1920,1080) };
34+ screen->m_position = QPoint(lastPoint.x(), lastPoint.y());
43− screen->geometry = QRect(lastPoint.x(), lastPoint.y(), 1024, 786 );
35+ screen->m_sizes.append(new ScreenMode(50, QSize(640,480)));
36+ screen->m_sizes.append(new ScreenMode(60, QSize(1280,1024)));
37+ screen->m_sizes.append(new ScreenMode(60, QSize(1440,900)));
38+ screen->m_sizes.append(new ScreenMode(60, QSize(1920,1080)));
39+ screen->m_currentModeIndex = 3;
40+ screen->m_physicalSize = QSize(800,568);
44 m_screenList.append(screen);
41 m_screenList.append(screen);
45
42
46− lastPoint.rx() += screen->geometry.width();
43+ lastPoint.rx() += screen->m_sizes[screen->m_currentModeIndex]->size.width();
47 }
44 }
48}
45}
49
46
@@ -57,13 +54,6 @@ QHash<int, QByteArray> Screens::roleNames() const
57{
54{
58 QHash<int, QByteArray> roles;
55 QHash<int, QByteArray> roles;
59 roles[ScreenRole] = "screen";
56 roles[ScreenRole] = "screen";
60− roles[OutputTypeRole] = "outputType";
61− roles[EnabledRole] = "enabled";
62− roles[NameRole] = "name";
63− roles[ScaleRole] = "scale";
64− roles[FormFactorRole] = "formFactor";
65− roles[GeometryRole] = "geometry";
66− roles[SizesRole] = "sizes";
67 return roles;
57 return roles;
68}
58}
69
59
@@ -75,28 +65,7 @@ QVariant Screens::data(const QModelIndex &index, int role) const
75
65
76 switch(role) {
66 switch(role) {
77 case ScreenRole:
67 case ScreenRole:
78− return QVariant::fromValue(m_screenList.at(index.row())->qScreen);
68+ return QVariant::fromValue(m_screenList.at(index.row()));
79− case OutputTypeRole:
80− return m_screenList.at(index.row())->outputTypes;
81− case EnabledRole:
82− return m_screenList.at(index.row())->enabled;
83− case NameRole:
84− return m_screenList.at(index.row())->name;
85− case ScaleRole:
86− return m_screenList.at(index.row())->scale;
87− case FormFactorRole:
88− return m_screenList.at(index.row())->formFactor;
89− case GeometryRole:
90− return m_screenList.at(index.row())->geometry;
91− case SizesRole:
92− {
93− QVariantList sizes;
94− auto availableSizes = m_screenList.at(index.row())->sizes;
95− Q_FOREACH(auto size, availableSizes) {
96− sizes.append(QVariant(size));
97− }
98− return sizes;
99− }
100 }
69 }
101
70
102 return QVariant();
71 return QVariant();
@@ -114,4 +83,32 @@ int Screens::count() const
114
83
115void Screens::activateScreen(int)
84void Screens::activateScreen(int)
116{
85{
86+ qWarning("Not Implemented");
87+}
88+
89+Screen::Screen(QObject* parent)
90+ : QObject(parent)
91+{
92+}
93+
94+Screen::~Screen()
95+{
96+ qDeleteAll(m_sizes);
97+ m_sizes.clear();
98+}
99+
100+QQmlListProperty<ScreenMode> Screen::availableModes()
101+{
102+ return QQmlListProperty<ScreenMode>(this, m_sizes);
103+}
104+
105+Screen *Screen::beginConfiguration()
106+{
107+ qWarning("Not Implemented");
108+ return nullptr;
109+}
110+
111+void Screen::applyConfiguration()
112+{
113+ qWarning("Not Implemented");
117}
114}
tests/mocks/Unity/Screens/screens.h+65−9
@@ -19,6 +19,7 @@
19
19
20#include <QAbstractListModel>
20#include <QAbstractListModel>
21#include <QScreen>
21#include <QScreen>
22+#include <QQmlListProperty>
22
23
23class Screen;
24class Screen;
24
25
@@ -90,17 +91,72 @@ private:
90 QList<Screen *> m_screenList;
91 QList<Screen *> m_screenList;
91};
92};
92
93
93−class Screen
94+class ScreenMode : public QObject
94{
95{
96+ Q_OBJECT
97+ Q_PROPERTY(qreal refreshRate MEMBER refreshRate CONSTANT)
98+ Q_PROPERTY(QSize size MEMBER size CONSTANT)
99+public:
100+ ScreenMode() {}
101+ ScreenMode(qreal refreshRate, QSize size):refreshRate(refreshRate),size(size) {}
102+ ScreenMode(const ScreenMode& other)
103+ : QObject(nullptr),
104+ refreshRate{other.refreshRate},size{other.size}
105+ {}
106+
107+ qreal refreshRate;
108+ QSize size;
109+};
110+
111+class Screen : public QObject
112+{
113+ Q_OBJECT
114+
115+ Q_PROPERTY(bool active MEMBER m_active NOTIFY activeChanged)
116+
117+ Q_PROPERTY(bool used MEMBER m_used NOTIFY usedChanged)
118+ Q_PROPERTY(QString name MEMBER m_name NOTIFY nameChanged)
119+ Q_PROPERTY(Screens::OutputTypes outputType MEMBER m_outputType NOTIFY outputTypeChanged)
120+ Q_PROPERTY(float scale MEMBER m_scale NOTIFY scaleChanged)
121+ Q_PROPERTY(Screens::FormFactor formFactor MEMBER m_formFactor NOTIFY formFactorChanged)
122+ Q_PROPERTY(QPoint position MEMBER m_position NOTIFY positionChanged)
123+ Q_PROPERTY(uint currentModeIndex MEMBER m_currentModeIndex NOTIFY currentModeIndexChanged)
124+ Q_PROPERTY(QQmlListProperty<ScreenMode> availableModes READ availableModes NOTIFY availableModesChanged)
125+ Q_PROPERTY(QSizeF physicalSize MEMBER m_physicalSize NOTIFY physicalSizeChanged)
95public:
126public:
127+ Screen(QObject* parent = 0);
128+ ~Screen();
129+
130+ QQmlListProperty<ScreenMode> availableModes();
131+
132+ Q_INVOKABLE Screen* beginConfiguration();
133+ Q_INVOKABLE void applyConfiguration();
134+
135+Q_SIGNALS:
136+ void activeChanged();
137+ void usedChanged();
138+ void nameChanged();
139+ void outputTypeChanged();
140+ void scaleChanged();
141+ void formFactorChanged();
142+ void positionChanged();
143+ void currentModeIndexChanged();
144+ void availableModesChanged();
145+ void physicalSizeChanged();
146+
147+public:
148+ bool m_active{false};
149+ bool m_used{true};
150+ QString m_name;
96− Screens::OutputTypes outputTypes = Screens::Unknown;
151+ Screens::OutputTypes m_outputType{Screens::Unknown};
97− QScreen *qScreen = nullptr;
98− bool enabled = false;
99− QString name = QString();
100− float scale = 1.0;
152+ float m_scale{1.0};
101− Screens::FormFactor formFactor = Screens::FormFactorMonitor;
153+ Screens::FormFactor m_formFactor{Screens::FormFactorMonitor};
102− QRect geometry;
154+ QPoint m_position;
103− QList<QSize> sizes;
155+ uint m_currentModeIndex{0};
156+ QList<ScreenMode*> m_sizes;
157+ QSizeF m_physicalSize;
104};
158};
105
159
160+Q_DECLARE_METATYPE(ScreenMode)
161+
106#endif // SCREENS_H
162#endif // SCREENS_H
tests/mocks/Unity/Screens/screenwindow.cpp+7−4
@@ -21,12 +21,15 @@ ScreenWindow::ScreenWindow(QWindow *parent)
21{
21{
22}
22}
23
23
24−QScreen *ScreenWindow::screen() const
24+Screen *ScreenWindow::screenWrapper() const
25{
25{
26− return QQuickWindow::screen();
26+ return m_screen.data();
27}
27}
28
28
29−void ScreenWindow::setScreen(QScreen *screen)
29+void ScreenWindow::setScreenWrapper(Screen *screen)
30{
30{
31− QQuickWindow::setScreen(screen);
31+ if (m_screen != screen) {
32+ m_screen = screen;
33+ Q_EMIT screenWrapperChanged();
34+ }
32}
35}
tests/mocks/Unity/Screens/screenwindow.h+10−4
@@ -18,19 +18,25 @@
18#define SCREENWINDOW_H
18#define SCREENWINDOW_H
19
19
20#include <QQuickWindow>
20#include <QQuickWindow>
21+#include <QPointer>
22+
23+#include "screens.h"
21
24
22class ScreenWindow : public QQuickWindow
25class ScreenWindow : public QQuickWindow
23{
26{
24 Q_OBJECT
27 Q_OBJECT
25− Q_PROPERTY(QScreen *screen READ screen WRITE setScreen NOTIFY screenChanged)
28+ Q_PROPERTY(Screen *screen READ screenWrapper WRITE setScreenWrapper NOTIFY screenWrapperChanged)
26public:
29public:
27 ScreenWindow(QWindow *parent = 0);
30 ScreenWindow(QWindow *parent = 0);
28
31
29− QScreen *screen() const;
32+ Screen *screenWrapper() const;
30− void setScreen(QScreen *screen);
33+ void setScreenWrapper(Screen *screen);
31
34
32Q_SIGNALS:
35Q_SIGNALS:
33− void screenChanged(QScreen *screen);
36+ void screenWrapperChanged();
37+
38+private:
39+ QPointer<Screen> m_screen;
34};
40};
35
41
36#endif // SCREENWINDOW_H
42#endif // SCREENWINDOW_H