Set current thread ID to bold in Thread IDS view.

This commit is contained in:
Ernie Pasveer
2021-11-08 10:22:40 -06:00
parent 39818ec6c1
commit bfa12d4c26
2 changed files with 14 additions and 1 deletions
+13 -1
View File
@@ -3,6 +3,7 @@
#include <QtWidgets/QTreeWidget>
#include <QtWidgets/QTreeWidgetItemIterator>
#include <QtWidgets/QApplication>
#include <QtGui/QFont>
#include <QtCore/QDebug>
SeerThreadIdsBrowserWidget::SeerThreadIdsBrowserWidget (QWidget* parent) : QWidget(parent) {
@@ -54,10 +55,21 @@ void SeerThreadIdsBrowserWidget::handleText (const QString& text) {
//qDebug() << __PRETTY_FUNCTION__ << ":" << threadid_text;
// Add the frame to the tree.
// Construct the item
QTreeWidgetItem* item = new QTreeWidgetItem;
item->setText(0, threadid_text);
// Set the text to bold if the ID is the same as the CURRENT ID.
QFont fnormal = item->font(0); fnormal.setBold(false);
QFont fbold = item->font(0); fbold.setBold(true);
if (threadid_text == currentthreadid_text) {
item->setFont(0, fbold);
}else{
item->setFont(0, fnormal);
}
// Add the frame to the tree.
idsTreeWidget->addTopLevelItem(item);
}