diff --git a/widgets/pushbutton.cpp b/widgets/pushbutton.cpp index 66256b850..563228306 100644 --- a/widgets/pushbutton.cpp +++ b/widgets/pushbutton.cpp @@ -260,6 +260,23 @@ void PushButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) 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 #include "pushbutton.moc" diff --git a/widgets/pushbutton.h b/widgets/pushbutton.h index 6bcb14838..bfb8ad3b4 100644 --- a/widgets/pushbutton.h +++ b/widgets/pushbutton.h @@ -134,6 +134,11 @@ public: */ void setFlat(bool flat); + // NOTE: bogus + QSizeF minimumSize() const; + Qt::Orientations expandingDirections() const; + QSizeF sizeHint() const; + Q_SIGNALS: /** * Triggered when the button has been clicked.