26 setCursor(Qt::PointingHandCursor);
35 int height = qMax(
_pixmap.height(), fontMetrics().height())+2;
36 int width =
_pixmap.width() + fontMetrics().width(
_text)+2;
37 return QSize(width, height);
52 QRect rect = this->rect();
55 p.setBrush(QColor(150,150,150));
56 rect.setX(rect.x()+1);
57 rect.setY(rect.y()+1);
58 rect.setWidth(rect.width());
59 rect.setHeight(rect.height());
69 if (
vApp->isLeftToRight()) {
71 p.drawPixmap(d, qMax((rect.height()-
_pixmap.height())/2+d, 0),
_pixmap);
73 p.drawText(
_pixmap.width()+2+d, (rect.height()+fontInfo().pixelSize())/2+d,
_text);
76 p.drawPixmap(qMax(rect.right()-
_pixmap.width()-d, d),
78 if (!
_text.isEmpty()) {
79 int textWidth = fontMetrics().width(
_text);
80 p.drawText(qMax(rect.right()-
_pixmap.width()-textWidth-2-d, d),
81 (rect.height()+fontInfo().pixelSize())/2-d,
_text);
91 if (e->button() == Qt::LeftButton) {
102 if (e->button() == Qt::LeftButton) {