10 #include <QWheelEvent>
45 return QRectF(
geometry(canvas_rect).topRight() + QPoint(-
s, -
s), QSize(
s * 2,
s * 2));
47 return QRectF(
geometry(canvas_rect).topLeft() + QPoint(-
s, -
s), QSize(
s * 2,
s * 2));
51 const QRectF& rect)
const
66 painter->setBrush(QBrush(Qt::white, Qt::SolidPattern));
67 painter->drawEllipse(iconRect);
71 iconRect -= QMarginsF(3, 3, 3, 3);
72 painter->setBrush(QBrush(col, Qt::SolidPattern));
73 painter->drawEllipse(iconRect);
86 const QRectF r = rect.toRect().adjusted(m, m, -m, -m);
88 painter->setClipRect(r, Qt::IntersectClip);
95 QRectF iconRect(r.topLeft(), graphic.
defaultSize());
97 iconRect.moveCenter(QPoint(iconRect.center().x(), rect.center().y()));
101 graphic.
render(painter, iconRect, Qt::KeepAspectRatio);
104 titleOff += iconRect.width() +
spacing();
113 pen.setColor(QColor(122, 122, 122));
119 painter->setPen(pen);
120 painter->setFont(
font());
122 const QRectF textRect = r.adjusted(titleOff, 0, 0, 0);
123 text.draw(painter, textRect);
134 painter->setPen(pen);
137 painter->drawRoundedRect(rect, radius, radius);
145 const QPoint press_point = mouse_event->pos();
147 if (
isVisible() && mouse_event->modifiers() == Qt::NoModifier)
149 if ((
hideButtonRect() + QMargins(2, 2, 2, 2)).contains(press_point))
161 if (item_rect.contains(press_point))