Changeset View
Changeset View
Standalone View
Standalone View
kcm/src/declarative/qmlscreen.cpp
Show All 28 Lines | |||||
29 | 29 | | |||
30 | QMLScreen::QMLScreen(QQuickItem *parent) | 30 | QMLScreen::QMLScreen(QQuickItem *parent) | ||
31 | : QQuickItem(parent) | 31 | : QQuickItem(parent) | ||
32 | { | 32 | { | ||
33 | connect(this, &QMLScreen::widthChanged, this, &QMLScreen::viewSizeChanged); | 33 | connect(this, &QMLScreen::widthChanged, this, &QMLScreen::viewSizeChanged); | ||
34 | connect(this, &QMLScreen::heightChanged, this, &QMLScreen::viewSizeChanged); | 34 | connect(this, &QMLScreen::heightChanged, this, &QMLScreen::viewSizeChanged); | ||
35 | } | 35 | } | ||
36 | 36 | | |||
37 | QMLScreen::~QMLScreen() | ||||
38 | { | ||||
39 | qDeleteAll(m_outputMap); | ||||
40 | m_outputMap.clear(); | ||||
41 | } | ||||
42 | | ||||
37 | KScreen::ConfigPtr QMLScreen::config() const | 43 | KScreen::ConfigPtr QMLScreen::config() const | ||
38 | { | 44 | { | ||
39 | return m_config; | 45 | return m_config; | ||
40 | } | 46 | } | ||
41 | 47 | | |||
42 | void QMLScreen::setConfig(const KScreen::ConfigPtr &config) | 48 | void QMLScreen::setConfig(const KScreen::ConfigPtr &config) | ||
43 | { | 49 | { | ||
44 | qDeleteAll(m_outputMap); | 50 | qDeleteAll(m_outputMap); | ||
Show All 37 Lines | 84 | { | |||
82 | QMLOutput *qmloutput = comp.createForOutput(output); | 88 | QMLOutput *qmloutput = comp.createForOutput(output); | ||
83 | if (!qmloutput) { | 89 | if (!qmloutput) { | ||
84 | qWarning() << "Failed to create QMLOutput"; | 90 | qWarning() << "Failed to create QMLOutput"; | ||
85 | return; | 91 | return; | ||
86 | } | 92 | } | ||
87 | 93 | | |||
88 | m_outputMap.insert(output, qmloutput); | 94 | m_outputMap.insert(output, qmloutput); | ||
89 | 95 | | |||
90 | qmloutput->setParentItem(this); | 96 | qmloutput->setParentItem(this); | ||
davidedmundson: this should clear them already? | |||||
broulik: `parentItem` is only visual parent, it doesn't communicate ownership | |||||
91 | qmloutput->setZ(m_outputMap.count()); | 97 | qmloutput->setZ(m_outputMap.count()); | ||
92 | 98 | | |||
93 | connect(output.data(), &KScreen::Output::isConnectedChanged, | 99 | connect(output.data(), &KScreen::Output::isConnectedChanged, | ||
94 | this, &QMLScreen::outputConnectedChanged); | 100 | this, &QMLScreen::outputConnectedChanged); | ||
95 | connect(output.data(), &KScreen::Output::isEnabledChanged, | 101 | connect(output.data(), &KScreen::Output::isEnabledChanged, | ||
96 | this, &QMLScreen::outputEnabledChanged); | 102 | this, &QMLScreen::outputEnabledChanged); | ||
97 | connect(output.data(), &KScreen::Output::posChanged, | 103 | connect(output.data(), &KScreen::Output::posChanged, | ||
98 | this, &QMLScreen::outputPositionChanged); | 104 | this, &QMLScreen::outputPositionChanged); | ||
▲ Show 20 Lines • Show All 253 Lines • Show Last 20 Lines |
this should clear them already?