'fixes' layouts for pushbuttons

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=696696
This commit is contained in:
Matt Broadstone 2007-08-05 17:03:18 +00:00
parent 5d05c8ac7e
commit f33c5ab58b
2 changed files with 22 additions and 0 deletions

View File

@ -260,6 +260,23 @@ void PushButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
update(); update();
} }
QSizeF PushButton::minimumSize() const
{
QFontMetricsF m = qApp->fontMetrics();
return m.boundingRect(text()).size() + QSizeF(5.0f, 5.0f);
}
Qt::Orientations PushButton::expandingDirections() const
{
return Qt::Horizontal;
}
QSizeF PushButton::sizeHint() const
{
return minimumSize();
}
} // namespace Plasma } // namespace Plasma
#include "pushbutton.moc" #include "pushbutton.moc"

View File

@ -134,6 +134,11 @@ public:
*/ */
void setFlat(bool flat); void setFlat(bool flat);
// NOTE: bogus
QSizeF minimumSize() const;
Qt::Orientations expandingDirections() const;
QSizeF sizeHint() const;
Q_SIGNALS: Q_SIGNALS:
/** /**
* Triggered when the button has been clicked. * Triggered when the button has been clicked.