| 93 | } |
| 94 | |
| 95 | void CollapseGroupBox::paintEvent(QPaintEvent *) |
| 96 | { |
| 97 | QStylePainter paint(this); |
| 98 | QStyleOptionGroupBox option; |
| 99 | initStyleOption(&option); |
| 100 | |
| 101 | // pretend we have a groupbox so the painting allocates space for it |
| 102 | option.subControls |= QStyle::SC_GroupBoxCheckBox; |
| 103 | |
| 104 | paint.drawComplexControl(QStyle::CC_GroupBox, option); |
| 105 | |
| 106 | // now paint over the checkbox |
| 107 | |
| 108 | QRect checkBoxRect = |
| 109 | style()->subControlRect(QStyle::CC_GroupBox, &option, QStyle::SC_GroupBoxCheckBox, this); |
| 110 | |
| 111 | paint.fillRect(checkBoxRect, palette().brush(QPalette::Window)); |
| 112 | |
| 113 | QStyleOption arrowOpt = option; |
| 114 | arrowOpt.rect = checkBoxRect; |
| 115 | paint.drawPrimitive(m_collapsed ? QStyle::PE_IndicatorArrowRight : QStyle::PE_IndicatorArrowDown, |
| 116 | arrowOpt); |
| 117 | } |
| 118 | |
| 119 | void CollapseGroupBox::mouseReleaseEvent(QMouseEvent *event) |
| 120 | { |
nothing calls this directly
no test coverage detected