Use setSize() instead of setProperty width and height
We know we have a QQuickItem so we can just use its methods directly and then also use setSize which does both at once, saving intermediate signal emission and potential re-layouting Differential Revision: https://phabricator.kde.org/D9068
This commit is contained in:
parent
5d9aa6816f
commit
b6b81c67b3
@ -137,8 +137,7 @@ void ContainmentViewPrivate::setContainment(Plasma::Containment *cont)
|
||||
|
||||
graphicObject->setFocus(true);
|
||||
//by resizing before adding, it will avoid some resizes in most cases
|
||||
graphicObject->setProperty("width", q->width());
|
||||
graphicObject->setProperty("height", q->height());
|
||||
graphicObject->setSize(q->size());
|
||||
graphicObject->setParentItem(q->rootObject());
|
||||
if (q->rootObject()) {
|
||||
q->rootObject()->setProperty("containment", QVariant::fromValue(graphicObject));
|
||||
|
@ -119,8 +119,7 @@ void ViewPrivate::setContainment(Plasma::Containment *cont)
|
||||
// qDebug() << "using as graphic containment" << graphicObject << containment.data();
|
||||
|
||||
//by resizing before adding, it will avoid some resizes in most cases
|
||||
graphicObject->setProperty("width", q->width());
|
||||
graphicObject->setProperty("height", q->height());
|
||||
graphicObject->setSize(q->size());
|
||||
graphicObject->setParentItem(q->rootObject());
|
||||
if (q->rootObject()) {
|
||||
q->rootObject()->setProperty("containment", QVariant::fromValue(graphicObject));
|
||||
|
Loading…
x
Reference in New Issue
Block a user