Results 1 to 10 of 10

Thread: How to update statusbar and tooltips

  1. #1
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question 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:rocessEvents, but it didnt help

    Is there anyway to update the tips on button click and show them instantly (without moving mouse ) ???

  2. #2
    Join Date
    May 2006
    Posts
    55
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to update statusbar and tooltips

    Hi
    May be sending a tooltip event would help ?
    Regards.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to update statusbar and tooltips

    Quote Originally Posted by aamer4yu View Post
    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:rocessEvents, but it didnt help

    Is there anyway to update the tips on button click and show them instantly (without moving mouse ) ???
    Can we see the code?

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: How to update statusbar and tooltips

    Ok.. here is the code of the function which gets called on button click from the toolbar.

    Qt Code:
    1. void CMainWindow::OnNextPipelineAction()
    2. {
    3. m_pipeline_stages.HighlightNextStage();
    4.  
    5. QString s = QString("PL %1").arg(m_pipeline_stages.m_current_stage_number);
    6. nextPipelineAction->setText(s);
    7. nextPipelineAction->setToolTip(m_pipeline_stages.GetCurrentStage().RowsCovered());
    8. nextPipelineAction->setStatusTip(m_pipeline_stages.GetCurrentStage().RowsCovered());
    9.  
    10. QCoreApplication::processEvents();
    11. update();
    12.  
    13. }
    To copy to clipboard, switch view to plain text mode 

    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

  5. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to update statusbar and tooltips

    Helloooo... ne one ther ??

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to update statusbar and tooltips

    You can try posting a QHelpEvent as already suggested.

  7. #7
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default 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

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to update statusbar and tooltips

    Consult the docs about a QHelpEvent then... You can use QCoreApplication::postEvent() to post an event.

  9. #9
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to update statusbar and tooltips

    Thanks,
    i will try it..

  10. #10
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default 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.
    J-P Nurmi

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.