| 940 | } |
| 941 | |
| 942 | void OutputWidgetArrow::drawObject(QPainter* painter, const QRectF& rect, QTextDocument* doc, int posInDocument, const QTextFormat& format) |
| 943 | { |
| 944 | QFontMetrics metrics(format.toCharFormat().font()); |
| 945 | |
| 946 | QTextCursor cursor(doc); |
| 947 | cursor.setPosition(posInDocument); |
| 948 | auto t = cursor.currentTable(); |
| 949 | assert(t != nullptr); |
| 950 | cursor.setPosition(t->lastPosition() + 2); |
| 951 | auto* f = cursor.currentFrame(); |
| 952 | assert(f != nullptr); |
| 953 | |
| 954 | auto ff = f->frameFormat(); |
| 955 | bool expanded = ff.property(OutputWidget::Property::Expanded).toBool(); |
| 956 | |
| 957 | auto tf = t->format(); |
| 958 | auto requiredFormat = static_cast<OutputWidget*>(parent())->headerTableFormat(); |
| 959 | if (tf.columnWidthConstraints()[0].rawValue() != |
| 960 | requiredFormat.columnWidthConstraints()[0].rawValue()) { |
| 961 | // Re-align |
| 962 | t->setFormat(requiredFormat); |
| 963 | f->setFrameFormat(static_cast<OutputWidget*>(parent())->frameFormat()); |
| 964 | } |
| 965 | |
| 966 | auto h2 = metrics.ascent() / 2; |
| 967 | auto w2 = h2 / 2; |
| 968 | |
| 969 | QPainterPath p; |
| 970 | p.moveTo(-w2, -h2); |
| 971 | p.lineTo(w2, 0); |
| 972 | p.lineTo(-w2, h2); |
| 973 | p.closeSubpath(); |
| 974 | painter->translate(rect.center()); |
| 975 | if (expanded) { |
| 976 | painter->rotate(90); |
| 977 | } |
| 978 | auto infoFormat = static_cast<OutputWidget*>(parent())->infoCharFormat(); |
| 979 | painter->fillPath(p, infoFormat.foreground()); |
| 980 | } |
| 981 | |
| 982 | void OutputWidget::on_toggleAll_pushButton_clicked() |
| 983 | { |
nothing calls this directly
no test coverage detected