Qt: ElidedLabel escapes HTML

ElidedLabel escapes HTML after !9261, so use its own methods to make text
small and italicized instead of passing in rich text.

IOGraphDialog used to make an error message, if it existed, bold.
Perhaps ElidedLabel should have a way to have prepended bold
text for such usage.
This commit is contained in:
John Thacker 2023-01-14 13:05:38 -05:00
parent a25bcce10a
commit 0c3c3e9342
2 changed files with 5 additions and 5 deletions

View File

@ -324,6 +324,7 @@ IOGraphDialog::IOGraphDialog(QWidget &parent, CaptureFile &cf, QString displayFi
datetime_ticker_(new QCPAxisTickerDateTime)
{
ui->setupUi(this);
ui->hintLabel->setSmallText();
loadGeometry();
setWindowSubtitle(tr("I/O Graphs"));
@ -1042,8 +1043,10 @@ void IOGraphDialog::mouseMoved(QMouseEvent *event)
QString hint;
Qt::CursorShape shape = Qt::ArrowCursor;
// XXX: ElidedLabel doesn't support rich text / HTML, we
// used to bold this error
if (!hint_err_.isEmpty()) {
hint += QString("<b>%1</b> ").arg(hint_err_);
hint += QString("%1 ").arg(hint_err_);
}
if (event) {
if (event->buttons().testFlag(Qt::LeftButton)) {
@ -1111,8 +1114,6 @@ void IOGraphDialog::mouseMoved(QMouseEvent *event)
}
}
hint.prepend("<small><i>");
hint.append("</i></small>");
ui->hintLabel->setText(hint);
}

View File

@ -78,6 +78,7 @@ SequenceDialog::SequenceDialog(QWidget &parent, CaptureFile &cf, SequenceInfo *i
QAction *action;
ui->setupUi(this);
ui->hintLabel->setSmallText();
QCustomPlot *sp = ui->sequencePlot;
setWindowSubtitle(info_ ? tr("Call Flow") : tr("Flow"));
@ -402,8 +403,6 @@ void SequenceDialog::mouseMoved(QMouseEvent *event)
}
}
hint.prepend("<small><i>");
hint.append("</i></small>");
ui->hintLabel->setText(hint);
}