Performance optimization: only change the icon if it's actually a different icon. Mainly affects uiserver widgets atm.
Oh, and warning--. svn path=/trunk/KDE/kdelibs/; revision=894878
This commit is contained in:
parent
e166600984
commit
b321b2f033
@ -185,14 +185,18 @@ QGraphicsItem *ExtenderItem::widget() const
|
|||||||
|
|
||||||
void ExtenderItem::setIcon(const QIcon &icon)
|
void ExtenderItem::setIcon(const QIcon &icon)
|
||||||
{
|
{
|
||||||
|
d->iconName = QString();
|
||||||
d->collapseIcon->setIcon(icon);
|
d->collapseIcon->setIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtenderItem::setIcon(const QString &icon)
|
void ExtenderItem::setIcon(const QString &icon)
|
||||||
{
|
{
|
||||||
|
if (icon != d->iconName) {
|
||||||
d->collapseIcon->setIcon(icon);
|
d->collapseIcon->setIcon(icon);
|
||||||
|
d->iconName = icon;
|
||||||
config().writeEntry("extenderIconName", icon);
|
config().writeEntry("extenderIconName", icon);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QIcon ExtenderItem::icon() const
|
QIcon ExtenderItem::icon() const
|
||||||
{
|
{
|
||||||
@ -480,6 +484,8 @@ void ExtenderItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
|
|||||||
|
|
||||||
void ExtenderItem::moveEvent(QGraphicsSceneMoveEvent *event)
|
void ExtenderItem::moveEvent(QGraphicsSceneMoveEvent *event)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(event);
|
||||||
|
|
||||||
if (d->toplevel) {
|
if (d->toplevel) {
|
||||||
d->toplevel->setSceneRect(sceneBoundingRect());
|
d->toplevel->setSceneRect(sceneBoundingRect());
|
||||||
update();
|
update();
|
||||||
|
@ -80,6 +80,7 @@ class ExtenderItemPrivate
|
|||||||
|
|
||||||
QString title;
|
QString title;
|
||||||
QString name;
|
QString name;
|
||||||
|
QString iconName;
|
||||||
|
|
||||||
uint extenderItemId;
|
uint extenderItemId;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user