| 43 | } |
| 44 | |
| 45 | void Section::Collapse(bool collapse) |
| 46 | { |
| 47 | if (_contentHeight != _content->sizeHint().height()) { |
| 48 | _contentHeight = _content->sizeHint().height(); |
| 49 | } |
| 50 | SetupAnimations(); |
| 51 | |
| 52 | _toggleButton->setChecked(collapse); |
| 53 | _toggleButton->setArrowType(collapse ? Qt::ArrowType::RightArrow |
| 54 | : Qt::ArrowType::DownArrow); |
| 55 | if (!_toggleAnimation) { |
| 56 | _collapsed = collapse; |
| 57 | emit Collapsed(collapse); |
| 58 | return; |
| 59 | } |
| 60 | |
| 61 | _toggleAnimation->setDirection(collapse ? QAbstractAnimation::Backward |
| 62 | : QAbstractAnimation::Forward); |
| 63 | _transitioning = true; |
| 64 | _collapsed = collapse; |
| 65 | _toggleAnimation->start(); |
| 66 | emit Collapsed(collapse); |
| 67 | } |
| 68 | |
| 69 | void Section::SetContent(QWidget *w) |
| 70 | { |
nothing calls this directly
no test coverage detected