Add ToolTips to the important browsers.

This commit is contained in:
Ernie Pasveer
2021-10-10 12:57:30 -05:00
parent 2ee3c2bf3a
commit 8617bf70ac
17 changed files with 205 additions and 40 deletions
+27 -14
View File
@@ -11,6 +11,7 @@ SeerThreadFramesBrowserWidget::SeerThreadFramesBrowserWidget (QWidget* parent) :
setupUi(this);
// Setup the widgets
threadTreeWidget->setMouseTracking(true);
threadTreeWidget->setSortingEnabled(false);
threadTreeWidget->resizeColumnToContents(0); // id
threadTreeWidget->resizeColumnToContents(1); // target-id
@@ -30,6 +31,7 @@ SeerThreadFramesBrowserWidget::SeerThreadFramesBrowserWidget (QWidget* parent) :
// Connect things.
QObject::connect(threadTreeWidget, &QTreeWidget::itemDoubleClicked, this, &SeerThreadFramesBrowserWidget::handleItemDoubleClicked);
QObject::connect(threadTreeWidget, &QTreeWidget::itemEntered, this, &SeerThreadFramesBrowserWidget::handleItemEntered);
}
SeerThreadFramesBrowserWidget::~SeerThreadFramesBrowserWidget () {
@@ -171,20 +173,6 @@ void SeerThreadFramesBrowserWidget::handleText (const QString& text) {
QApplication::restoreOverrideCursor();
}
void SeerThreadFramesBrowserWidget::handleItemDoubleClicked (QTreeWidgetItem* item, int column) {
Q_UNUSED(column);
int lineno = item->text(9).toInt();
//qDebug() << __PRETTY_FUNCTION__ << ":" << "Emit selectedFile and selectedFrame";
emit selectedFile(item->text(7), item->text(8), lineno);
// Comment out this signal. The frame number is always 0 from gdb. Why?
//emit selectedFrame(item->text(3).toInt());
}
void SeerThreadFramesBrowserWidget::handleStoppingPointReached () {
// Don't do any work if the widget is hidden.
@@ -199,6 +187,31 @@ void SeerThreadFramesBrowserWidget::refresh () {
emit refreshThreadFrames();
}
void SeerThreadFramesBrowserWidget::handleItemDoubleClicked (QTreeWidgetItem* item, int column) {
Q_UNUSED(column);
int lineno = item->text(9).toInt();
//qDebug() << __PRETTY_FUNCTION__ << ":" << "Emit selectedFile and selectedFrame";
emit selectedFile(item->text(7), item->text(8), lineno);
// Comment out this signal. The frame number is always 0 from gdb. Why?
//emit selectedFrame(item->text(3).toInt());
}
void SeerThreadFramesBrowserWidget::handleItemEntered (QTreeWidgetItem* item, int column) {
//qDebug() << __PRETTY_FUNCTION__ << ":" << item->text(0) << column;
item->setToolTip(0, item->text(0) + " : " + item->text(11) + " : " + item->text(5) + " : " + item->text(7) + " : " + item->text(9));
for (int i=1; i<threadTreeWidget->columnCount(); i++) { // Copy tooltip to other columns.
item->setToolTip(i, item->toolTip(0));
}
}
void SeerThreadFramesBrowserWidget::showEvent (QShowEvent* event) {
QWidget::showEvent(event);