I have a local status bar on each of my "tab" widgets (widgets within a QTabWidget). These local status bars do not behave like the main window status bar. The local messages only appear if the mouse hovers over the "tab" widget, and while the mouse is over the "tab" widget the messages do not update. I'm doing tabbed searching of the local filesystem such that each "tab" widget (containing a QTreeView) performs a distinct search. I need the filepaths to permanently, and possibly rapidly, display and update on the local status bar regardless of the mouse position as I traverse the filesystem.
I add the status bar with:
tui->gridLayout_3->addWidget(statusBar, 3, 0, 1, 3);
statusBar = new QStatusBar;
tui->gridLayout_3->addWidget(statusBar, 3, 0, 1, 3);
To copy to clipboard, switch view to plain text mode
I intercept events with:
if(e
->type
() == QEvent::StatusTip){ statusBar->showMessage(ev->tip());
return true;
}
}
bool Tab::event(QEvent *e) {
if(e->type() == QEvent::StatusTip){
QStatusTipEvent *ev = (QStatusTipEvent*)e;
statusBar->showMessage(ev->tip());
return true;
}
return QWidget::event(e);
}
To copy to clipboard, switch view to plain text mode
and I trigger events with:
this->setStatusTip(s);
this->setStatusTip(s);
To copy to clipboard, switch view to plain text mode
I get my message, 's', in the local status bar but only on what I think is a mouse enter event. I call setStatusTip() repeatedly in a tight loop but I only see the latest message when the mouse enters the widget. I want the message on these local status bars to update continuously and always be visible. Can you do it?
Bookmarks