fix crash; you can't suppose that you get a Widget in ::paint
CCMAIL:tokoe@kde.org svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=718009
This commit is contained in:
parent
cc626be7e0
commit
c982fdde3b
@ -144,12 +144,14 @@ PushButton::~PushButton()
|
||||
void PushButton::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *opt, QWidget *widget)
|
||||
{
|
||||
QStyleOptionButton option;
|
||||
if (widget) {
|
||||
option.initFrom(widget);
|
||||
}
|
||||
d->initStyleOption(&option, this, opt);
|
||||
|
||||
widget->style()->drawPrimitive(QStyle::PE_PanelButtonCommand, &option, painter, widget);
|
||||
widget->style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, painter, widget);
|
||||
widget->style()->drawControl(QStyle::CE_PushButton, &option, painter, widget);
|
||||
QApplication::style()->drawPrimitive(QStyle::PE_PanelButtonCommand, &option, painter, widget);
|
||||
QApplication::style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, painter, widget);
|
||||
QApplication::style()->drawControl(QStyle::CE_PushButton, &option, painter, widget);
|
||||
}
|
||||
|
||||
void PushButton::setText(const QString& text)
|
||||
|
Loading…
x
Reference in New Issue
Block a user