Warning, /plasma/plasma-workspace/lookandfeel/sddm-theme/dummydata/screenModel.qml is written in an unsupported language. File is not indexed.
0001 import QtQuick 2.15
0002
0003 //NOTE: We do not implement a fully working dummy screenModel,
0004 //we only implement what's needed for a basic multi-monitor test
0005
0006 ListModel {
0007 property int primary: 0
0008
0009 //Creating multiple ListElement objects doesn't work, because a ListElement can only take numbers,
0010 //strings, booleans or enums, but we need a rect (it stores the screen size/position).
0011 //We can insert rects into the ListModel by using this workaround
0012 //It's taken from: https://stackoverflow.com/questions/20537417/add-statically-object-to-listmodel
0013
0014 //We create two monitors here, the left one 800x600 and the right one 800x400 pixels
0015 //To disable a screen delete one of the "append" function calls
0016 Component.onCompleted: {
0017 append({
0018 name: "Screen 1",
0019 geometry: {x: 0, y: 0, width: 1600, height: 900},
0020 });
0021
0022 append({
0023 name: "Screen 2",
0024 geometry: {x: 1980, y: 0, width: 1600, height: 900},
0025 });
0026 }
0027
0028 function geometry() {
0029 //return the primary monitor size
0030 return Qt.rect(800, 0, 800, 400);
0031 }
0032 }