Qt4.5 hit qt-copy, and layouts behave properly now! Let's remove the layout bug workaround
hacks from extenders. This improves behavior a lot. :) svn path=/trunk/KDE/kdelibs/; revision=922575
This commit is contained in:
parent
83f2503169
commit
1eb7e181bc
25
extender.cpp
25
extender.cpp
@ -224,13 +224,6 @@ void Extender::itemAddedEvent(ExtenderItem *item, const QPointF &pos)
|
|||||||
|
|
||||||
//remove the empty extender message if needed.
|
//remove the empty extender message if needed.
|
||||||
d->updateEmptyExtenderLabel();
|
d->updateEmptyExtenderLabel();
|
||||||
|
|
||||||
//if the item doesn't got a widget one will be set real soon, causing it's sizehints to
|
|
||||||
//change. Don't adjust the size hints in that case, since that spares us a call to
|
|
||||||
//adjustSizeHints()
|
|
||||||
if (item->widget()) {
|
|
||||||
d->adjustSizeHints();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extender::itemRemovedEvent(ExtenderItem *item)
|
void Extender::itemRemovedEvent(ExtenderItem *item)
|
||||||
@ -245,7 +238,6 @@ void Extender::itemRemovedEvent(ExtenderItem *item)
|
|||||||
|
|
||||||
//add the empty extender message if needed.
|
//add the empty extender message if needed.
|
||||||
d->updateEmptyExtenderLabel();
|
d->updateEmptyExtenderLabel();
|
||||||
d->adjustSizeHints();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extender::itemHoverEnterEvent(ExtenderItem *item)
|
void Extender::itemHoverEnterEvent(ExtenderItem *item)
|
||||||
@ -279,7 +271,6 @@ void Extender::itemHoverMoveEvent(ExtenderItem *item, const QPointF &pos)
|
|||||||
|
|
||||||
//Make sure we remove any 'no detachables' label that might be there, and update the layout.
|
//Make sure we remove any 'no detachables' label that might be there, and update the layout.
|
||||||
d->updateEmptyExtenderLabel();
|
d->updateEmptyExtenderLabel();
|
||||||
d->adjustSizeHints();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Extender::itemHoverLeaveEvent(ExtenderItem *item)
|
void Extender::itemHoverLeaveEvent(ExtenderItem *item)
|
||||||
@ -295,7 +286,6 @@ void Extender::itemHoverLeaveEvent(ExtenderItem *item)
|
|||||||
d->currentSpacerIndex = -1;
|
d->currentSpacerIndex = -1;
|
||||||
|
|
||||||
d->updateEmptyExtenderLabel();
|
d->updateEmptyExtenderLabel();
|
||||||
d->adjustSizeHints();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,21 +448,6 @@ void ExtenderPrivate::updateBorders()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtenderPrivate::adjustSizeHints()
|
|
||||||
{
|
|
||||||
//FIXME: what happens in this function are some nasty workarounds for a bug in qt4.4's QGL.
|
|
||||||
//Alexis has told me they are working on a fix for qt4.5, so this can be removed once the bug
|
|
||||||
//has been fixed in Qt.
|
|
||||||
if (layout) {
|
|
||||||
layout->updateGeometry();
|
|
||||||
q->setMinimumSize(layout->preferredSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
q->adjustSize();
|
|
||||||
|
|
||||||
emit q->geometryChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ExtenderPrivate::updateEmptyExtenderLabel()
|
void ExtenderPrivate::updateEmptyExtenderLabel()
|
||||||
{
|
{
|
||||||
if (q->attachedItems().isEmpty() && !emptyExtenderLabel && !emptyExtenderMessage.isEmpty()
|
if (q->attachedItems().isEmpty() && !emptyExtenderLabel && !emptyExtenderMessage.isEmpty()
|
||||||
|
@ -445,7 +445,6 @@ void ExtenderItem::setCollapsed(bool collapsed)
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
d->extender->d->adjustSizeHints();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExtenderItem::returnToSource()
|
void ExtenderItem::returnToSource()
|
||||||
|
@ -50,7 +50,6 @@ class ExtenderPrivate
|
|||||||
int insertIndexFromPos(const QPointF &pos) const;
|
int insertIndexFromPos(const QPointF &pos) const;
|
||||||
void loadExtenderItems();
|
void loadExtenderItems();
|
||||||
void updateBorders();
|
void updateBorders();
|
||||||
void adjustSizeHints();
|
|
||||||
void updateEmptyExtenderLabel();
|
void updateEmptyExtenderLabel();
|
||||||
|
|
||||||
Extender *q;
|
Extender *q;
|
||||||
|
Loading…
Reference in New Issue
Block a user