the fact that the toolbutton is using qstyle for the label painting makes reimplementation of the size hint really problematic, just use the native one for now

svn path=/trunk/KDE/kdelibs/; revision=1071247
This commit is contained in:
Marco Martin 2010-01-07 19:21:57 +00:00
parent 81e9c74cd3
commit 35d8587114

View File

@ -436,17 +436,6 @@ QSizeF ToolButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const
{
QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint);
if (hint.isEmpty()) {
return hint;
}
//replace the native margin with the Svg one
QStyleOption option;
option.initFrom(nativeWidget());
int nativeMargin = nativeWidget()->style()->pixelMetric(QStyle::PM_ButtonMargin, &option, nativeWidget());
qreal left, top, right, bottom;
d->background->getMargins(left, top, right, bottom);
hint = hint - QSize(nativeMargin, nativeMargin) + QSize(left+right, top+bottom);
return hint;
}