mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-24 10:25:36 +00:00
QtQuick: Only emit when there's something to change
This commit is contained in:
parent
a7b165c0f2
commit
84854afb64
|
@ -293,14 +293,19 @@ void PageItem::geometryChanged(const QRectF &newGeometry,
|
|||
return;
|
||||
}
|
||||
|
||||
bool changed = false;
|
||||
if (newGeometry.size() != oldGeometry.size()) {
|
||||
changed = true;
|
||||
m_redrawTimer->start();
|
||||
}
|
||||
|
||||
QQuickItem::geometryChanged(newGeometry, oldGeometry);
|
||||
//Why aren't they automatically emuitted?
|
||||
emit widthChanged();
|
||||
emit heightChanged();
|
||||
|
||||
if (changed) {
|
||||
//Why aren't they automatically emuitted?
|
||||
emit widthChanged();
|
||||
emit heightChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void PageItem::paint(QPainter *painter)
|
||||
|
|
Loading…
Reference in a new issue