delay itemAddedEvent at the end of the event loop:
if an item is added in a group right after creation, an itemAddedEvent shouldn't happen at all svn path=/trunk/KDE/kdelibs/; revision=1177226
This commit is contained in:
parent
f16e46eb86
commit
8992e628f8
@ -612,8 +612,7 @@ void ExtenderPrivate::addExtenderItem(ExtenderItem *item, const QPointF &pos)
|
||||
QObject::connect(item, SIGNAL(destroyed(ExtenderItem*)), q, SLOT(extenderItemDestroyed(ExtenderItem*)));
|
||||
attachedExtenderItems.append(item);
|
||||
q->itemHoverLeaveEvent(item);
|
||||
q->itemAddedEvent(item, pos);
|
||||
emit q->itemAttached(item);
|
||||
QTimer::singleShot(0, q, SLOT(delayItemAddedEvent()));
|
||||
}
|
||||
|
||||
void ExtenderPrivate::removeExtenderItem(ExtenderItem *item)
|
||||
@ -750,6 +749,15 @@ void ExtenderPrivate::updateBorders()
|
||||
}
|
||||
}
|
||||
|
||||
void ExtenderPrivate::delayItemAddedEvent()
|
||||
{
|
||||
while (!pendingItems.isEmpty()) {
|
||||
QPair<Plasma::ExtenderItem *, QPointF> item = pendingItems.first();
|
||||
q->itemAddedEvent(item.first, item.second);
|
||||
pendingItems.pop_front();
|
||||
}
|
||||
}
|
||||
|
||||
void ExtenderPrivate::updateEmptyExtenderLabel()
|
||||
{
|
||||
if (q->isEmpty() && !emptyExtenderLabel &&
|
||||
|
@ -303,6 +303,7 @@ class PLASMA_EXPORT Extender : public QGraphicsWidget
|
||||
private:
|
||||
ExtenderPrivate *const d;
|
||||
|
||||
Q_PRIVATE_SLOT(d, void delayItemAddedEvent())
|
||||
Q_PRIVATE_SLOT(d, void extenderItemDestroyed(ExtenderItem *item))
|
||||
|
||||
friend class ExtenderPrivate;
|
||||
|
Loading…
Reference in New Issue
Block a user