don't crash on parse errors
This commit is contained in:
parent
e9188f712a
commit
4c2e802a7d
|
@ -216,25 +216,25 @@ QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::title()
|
||||||
if (m_rootObject) {
|
if (m_rootObject) {
|
||||||
return m_rootObject.data()->property("title").value<QDeclarativeListProperty<QGraphicsObject> >();
|
return m_rootObject.data()->property("title").value<QDeclarativeListProperty<QGraphicsObject> >();
|
||||||
} else {
|
} else {
|
||||||
return QDeclarativeListProperty<QGraphicsObject>();
|
return QDeclarativeListProperty<QGraphicsObject>(this, m_dummyTitleElements);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::content() const
|
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::content()
|
||||||
{
|
{
|
||||||
if (m_rootObject) {
|
if (m_rootObject) {
|
||||||
return m_rootObject.data()->property("content").value<QDeclarativeListProperty<QGraphicsObject> >();
|
return m_rootObject.data()->property("content").value<QDeclarativeListProperty<QGraphicsObject> >();
|
||||||
} else {
|
} else {
|
||||||
return QDeclarativeListProperty<QGraphicsObject>();
|
return QDeclarativeListProperty<QGraphicsObject>(this, m_dummyContentElements);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::buttons() const
|
QDeclarativeListProperty<QGraphicsObject> FullScreenDialog::buttons()
|
||||||
{
|
{
|
||||||
if (m_rootObject) {
|
if (m_rootObject) {
|
||||||
return m_rootObject.data()->property("buttons").value<QDeclarativeListProperty<QGraphicsObject> >();
|
return m_rootObject.data()->property("buttons").value<QDeclarativeListProperty<QGraphicsObject> >();
|
||||||
} else {
|
} else {
|
||||||
return QDeclarativeListProperty<QGraphicsObject>();
|
return QDeclarativeListProperty<QGraphicsObject>(this, m_dummyButtonsElements);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,8 +56,8 @@ public:
|
||||||
|
|
||||||
//QML properties
|
//QML properties
|
||||||
QDeclarativeListProperty<QGraphicsObject> title();
|
QDeclarativeListProperty<QGraphicsObject> title();
|
||||||
QDeclarativeListProperty<QGraphicsObject> content() const;
|
QDeclarativeListProperty<QGraphicsObject> content();
|
||||||
QDeclarativeListProperty<QGraphicsObject> buttons() const;
|
QDeclarativeListProperty<QGraphicsObject> buttons();
|
||||||
DialogStatus::Status status() const;
|
DialogStatus::Status status() const;
|
||||||
|
|
||||||
Q_INVOKABLE void open();
|
Q_INVOKABLE void open();
|
||||||
|
@ -86,6 +86,11 @@ private:
|
||||||
QGraphicsScene *m_scene;
|
QGraphicsScene *m_scene;
|
||||||
QWeakPointer<QObject> m_rootObject;
|
QWeakPointer<QObject> m_rootObject;
|
||||||
static uint s_numItems;
|
static uint s_numItems;
|
||||||
|
|
||||||
|
//those only used in case of error, to not make plasma crash
|
||||||
|
QList<QGraphicsObject *> m_dummyTitleElements;
|
||||||
|
QList<QGraphicsObject *> m_dummyContentElements;
|
||||||
|
QList<QGraphicsObject *> m_dummyButtonsElements;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user