@@ -18,11 +18,8 @@
20#include <QGuiApplication>
20#include <QGuiApplication>
22#include <QDebug>
21#include <QDebug>
24−Q_DECLARE_METATYPE(QScreen*)
26Screens::Screens(QObject *parent) :
23Screens::Screens(QObject *parent) :
27 QAbstractListModel(parent)
24 QAbstractListModel(parent)
@@ -32,13 +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− screen->name = QString("Monitor %1").arg(i);
33+ screen->m_name = QString("Monitor %1").arg(i);
37− 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());
38− 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(300,200);
39 m_screenList.append(screen);
41 m_screenList.append(screen);
41− lastPoint.rx() += screen->geometry.width();
43+ lastPoint.rx() += screen->m_sizes[screen->m_currentModeIndex]->size.width();
@@ -52,13 +54,6 @@ QHash<int, QByteArray> Screens::roleNames() const
53 QHash<int, QByteArray> roles;
55 QHash<int, QByteArray> roles;
54 roles[ScreenRole] = "screen";
56 roles[ScreenRole] = "screen";
55− roles[OutputTypeRole] = "outputType";
56− roles[EnabledRole] = "enabled";
57− roles[NameRole] = "name";
58− roles[ScaleRole] = "scale";
59− roles[FormFactorRole] = "formFactor";
60− roles[GeometryRole] = "geometry";
61− roles[SizesRole] = "sizes";
62 return roles;
57 return roles;
@@ -70,28 +65,7 @@ QVariant Screens::data(const QModelIndex &index, int role) const
71 switch(role) {
66 switch(role) {
72 case ScreenRole:
67 case ScreenRole:
73− return QVariant::fromValue(m_screenList.at(index.row())->qScreen);
68+ return QVariant::fromValue(m_screenList.at(index.row()));
75− return m_screenList.at(index.row())->outputTypes;
77− return m_screenList.at(index.row())->enabled;
79− return m_screenList.at(index.row())->name;
81− return m_screenList.at(index.row())->scale;
83− return m_screenList.at(index.row())->formFactor;
85− return m_screenList.at(index.row())->geometry;
89− auto availableSizes = m_screenList.at(index.row())->sizes;
90− Q_FOREACH(auto size, availableSizes) {
91− sizes.append(QVariant(size));
97 return QVariant();
71 return QVariant();
@@ -109,4 +83,32 @@ int Screens::count() const
110void Screens::activateScreen(int)
84void Screens::activateScreen(int)
86+ qWarning("Not Implemented");
89+Screen::Screen(QObject* parent)
100+QQmlListProperty<ScreenMode> Screen::availableModes()
102+ return QQmlListProperty<ScreenMode>(this, m_sizes);
105+Screen *Screen::beginConfiguration()
107+ qWarning("Not Implemented");
111+void Screen::applyConfiguration()
113+ qWarning("Not Implemented");