How to update statusbar and tooltips
I have a button on toolbar, which when clicked changes the Text, Tooltip and Statustip.
How do I update the same without moving the mouse ??
I tried calling update on mainwindow, and also QCoreApplication::processEvents, but it didnt help :(
Is there anyway to update the tips on button click and show them instantly (without moving mouse ) ??? :confused:
Re: How to update statusbar and tooltips
Hi
May be sending a tooltip event would help ?
Regards.
Re: How to update statusbar and tooltips
Quote:
Originally Posted by
aamer4yu
I have a button on toolbar, which when clicked changes the Text, Tooltip and Statustip.
How do I update the same without moving the mouse ??
I tried calling update on mainwindow, and also QCoreApplication::processEvents, but it didnt help :(
Is there anyway to update the tips on button click and show them instantly (without moving mouse ) ??? :confused:
Can we see the code?
Re: How to update statusbar and tooltips
Ok.. here is the code of the function which gets called on button click from the toolbar.
Code:
void CMainWindow::OnNextPipelineAction()
{
m_pipeline_stages.HighlightNextStage();
QString s
= QString("PL %1").
arg(m_pipeline_stages.
m_current_stage_number);
nextPipelineAction->setText(s);
nextPipelineAction->setToolTip(m_pipeline_stages.GetCurrentStage().RowsCovered());
nextPipelineAction->setStatusTip(m_pipeline_stages.GetCurrentStage().RowsCovered());
update();
}
Here I am setting the text, tooltip and statustip of the button. I want that as soon as the button is pressed, the updated tooltip and statustip are displayed immediately.
the processevents and update are not helping in this regard. What am I missing :confused:
Re: How to update statusbar and tooltips
Helloooo... ne one ther ??
Re: How to update statusbar and tooltips
You can try posting a QHelpEvent as already suggested.
Re: How to update statusbar and tooltips
and how do i post a helpevent ??
sorry i may sound silly, but i have no idea about helpevent :(
Re: How to update statusbar and tooltips
Consult the docs about a QHelpEvent then... You can use QCoreApplication::postEvent() to post an event.
Re: How to update statusbar and tooltips
Thanks, :)
i will try it..
Re: How to update statusbar and tooltips
A tip: post the help event to the widget associated for the action in the toolbar (see QToolBar::widgetForAction()). It won't work if you post the event directly to the toolbar or the action.