17 if (qobject_cast<QPushButton*>(pwgt)) {
18 pwgt->setAttribute(Qt::WA_Hover,
true);
25 if (qobject_cast<QPushButton*>(pwgt)) {
26 pwgt->setAttribute(Qt::WA_Hover,
false);
32 const QStyleOption* popt,
38 case PE_PanelButtonCommand:
40 const QStyleOptionButton* pOptionButton =
41 qstyleoption_cast<
const QStyleOptionButton*>(popt);
43 bool bDown = (pOptionButton->state & State_Sunken)
44 || (pOptionButton->state & State_On);
46 QPixmap pix = bDown ? QPixmap(
":/images/btnprs.bmp")
47 : QPixmap(
":/images/btn.bmp");
49 ppainter->drawPixmap(pOptionButton->rect, pix);
51 bool bHover = (pOptionButton->state & State_Enabled)
52 && (pOptionButton->state & State_MouseOver);
54 ppainter->fillRect(pOptionButton->rect,
55 QColor(25, 97, 45, 83)
63 QCommonStyle::drawPrimitive(elem, popt, ppainter, pwgt);
virtual void unpolish(QWidget *pwgt)
virtual void drawPrimitive(PrimitiveElement elem, const QStyleOption *popt, QPainter *ppainter, const QWidget *pwgt=0) const
virtual void polish(QWidget *pwgt)