IconItem: Schedule pixmap update when window changes
QQuickItem::polish is not called when window changes.
Regression from 344d04e230
REVIEW: 127342
This commit is contained in:
parent
46a1181587
commit
fd46322300
@ -410,5 +410,23 @@ void IconItemTest::animatingEnabledChange()
|
||||
QVERIFY(img1 != img2); // animation is running
|
||||
}
|
||||
|
||||
void IconItemTest::windowChanged()
|
||||
{
|
||||
QQuickItem *item = createIconItem();
|
||||
item->setProperty("animated", false);
|
||||
item->setProperty("source", "tst-plasma-framework-test-icon");
|
||||
QImage img = grabImage(item);
|
||||
|
||||
QQuickView newView;
|
||||
newView.setSource(QUrl::fromLocalFile(QFINDTESTDATA("data/view.qml")));
|
||||
newView.show();
|
||||
QTest::qWaitForWindowExposed(&newView);
|
||||
|
||||
item->setProperty("visible", false);
|
||||
item->setParentItem(newView.rootObject());
|
||||
item->setProperty("visible", true);
|
||||
QCOMPARE(grabImage(item), img);
|
||||
}
|
||||
|
||||
QTEST_MAIN(IconItemTest)
|
||||
|
||||
|
@ -52,6 +52,7 @@ private Q_SLOTS:
|
||||
void changeColorGroup();
|
||||
void animatingActiveChange();
|
||||
void animatingEnabledChange();
|
||||
void windowChanged();
|
||||
|
||||
private:
|
||||
QQuickItem *createIconItem();
|
||||
|
@ -69,6 +69,9 @@ IconItem::IconItem(QQuickItem *parent)
|
||||
connect(this, &QQuickItem::enabledChanged,
|
||||
this, &IconItem::enabledChanged);
|
||||
|
||||
connect(this, &QQuickItem::windowChanged,
|
||||
this, &IconItem::schedulePixmapUpdate);
|
||||
|
||||
//initialize implicit size to the Dialog size
|
||||
setImplicitWidth(KIconLoader::global()->currentSize(KIconLoader::Dialog));
|
||||
setImplicitHeight(KIconLoader::global()->currentSize(KIconLoader::Dialog));
|
||||
|
Loading…
Reference in New Issue
Block a user