41 ui->TWErrorList->clear();
42 ui->TWErrorList->setRowCount(0);
44 for (
auto& ErrorEntry : ErrorEntries)
49 const auto Row =
ui->TWErrorList->rowCount();
50 ui->TWErrorList->insertRow(Row);
52 ui->TWErrorList->setItem(Row, 0,
new QTableWidgetItem(Icon, ErrorEntry.Text));
53 ui->TWErrorList->item(Row, 0)->setToolTip(
"Double-click to go to item.");
54 ui->TWErrorList->item(Row, 0)->setData(Qt::ItemDataRole::UserRole, QVariant::fromValue(ErrorEntry.TreeWidgetItem));
55 ui->TWErrorList->setItem(Row, 1,
new QTableWidgetItem(ErrorEntry.Origin));
56 ui->TWErrorList->item(Row, 1)->setToolTip(
ui->TWErrorList->item(Row, 0)->toolTip());
57 ui->TWErrorList->item(Row, 1)->setData(Qt::ItemDataRole::UserRole, QVariant::fromValue(ErrorEntry.TreeWidgetItem));
60 if (ErrorEntries.empty())
62 ui->TWErrorList->insertRow(0);
64 ui->TWErrorList->item(0, 0)->setToolTip(
ui->TWErrorList->item(0, 0)->text());
81 QVector<QPointF> BalloonVertices;
82 const float Offset = 0;
83 BalloonVertices << QPointF(Offset, Offset)
84 << QPointF(width() - Offset, Offset)
85 << QPointF(width() - Offset, height() * 0.97)
86 << QPointF(width() * 0.04, height() * 0.97)
87 << QPointF(width() * 0.03, height() - Offset)
88 << QPointF(width() * 0.02, height() * 0.97)
89 << QPointF(Offset, height() * 0.97);
90 auto BalloonPolygon = QPolygonF(BalloonVertices);
92 QPainter painter(
this);
93 painter.setRenderHint(QPainter::Antialiasing,
true);
94 painter.setBrush(QBrush(
ui->TWErrorList->palette().color(QWidget::backgroundRole())));
95 painter.setPen(QPen(
ui->TWErrorList->palette().color(QWidget::foregroundRole())));
97 QRegion Mask(BalloonPolygon.toPolygon(), Qt::WindingFill);
98 painter.drawPolygon(BalloonPolygon);
101 ui->TWErrorList->horizontalHeader()->resizeSection(0, width() / 4 * 3);
QTreeWidgetItem * TreeWidgetItem
Pointer to QTreeWidgetItem listed in main window's tree view. Do not dereference this pointer!...
Util::ErrorType ErrorType
bool operator==(const ErrorEntryType &Other) const