MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / paintEvent

Method paintEvent

widgets/RefactorWidget.cpp:47–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void CustomSplitterHandle::paintEvent(QPaintEvent *)
48{
49 QPainter painter(this);
50 painter.setRenderHint(QPainter::Antialiasing);
51
52 QColor bgColor = Utils::creatorColor(Utils::Theme::BackgroundColorHover);
53 bgColor.setAlpha(m_hovered ? 150 : 50);
54 painter.fillRect(rect(), bgColor);
55
56 QColor lineColor = Utils::creatorColor(Utils::Theme::SplitterColor);
57 lineColor.setAlpha(m_hovered ? 255 : 180);
58
59 const int lineWidth = m_hovered ? 3 : 2;
60 const int margin = 10;
61 painter.setPen(QPen(lineColor, lineWidth));
62
63 if (orientation() == Qt::Horizontal) {
64 int x = width() / 2;
65 painter.drawLine(x, margin, x, height() - margin);
66
67 painter.setBrush(lineColor);
68 int centerY = height() / 2;
69 const int dotSize = m_hovered ? 3 : 2;
70 const int dotSpacing = 8;
71 for (int i = -2; i <= 2; ++i) {
72 painter.drawEllipse(QPoint(x, centerY + i * dotSpacing), dotSize, dotSize);
73 }
74 } else {
75 int y = height() / 2;
76 painter.drawLine(margin, y, width() - margin, y);
77 }
78}
79
80void CustomSplitterHandle::enterEvent(QEnterEvent *event)
81{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected