Results 1 to 3 of 3

Thread: Refreshing QAction Text in a QSystemTrayIcon context menu while is showing

  1. #1
    Join Date
    Dec 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Refreshing QAction Text in a QSystemTrayIcon context menu while is showing

    Hi,

    I need to be able to refresh a QAction Text in a QSystemTrayIcon context menu while is showing.
    I don't know if it's possible, but it's doesn't seem to be straightforward:

    I have a context menu added as a context menu for a QSystemTrayIcon.

    Some QAction shows a progress value in their text. A timer check the progress value
    and updates the QAction text.

    When i click on my systray icon, the QAction text are updated as expected.
    But if the menu is showing, the text is not updated. Added or Removed actions
    neither.

    Any idea?

    Thanks!
    Choubaka

  2. #2
    Join Date
    Aug 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Refreshing QAction Text in a QSystemTrayIcon context menu while is showing

    Hi,

    Nobody answered it and now i'm worried because I'm trying to do the exact same thing. Have you succeeded ?

    Thanks!

  3. #3
    Join Date
    Aug 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Refreshing QAction Text in a QSystemTrayIcon context menu while is showing

    Solved! A quick look at the Qt source code helped me! Don't know if it is the best way to do this...

    SmartQMenu::UpdateableQMenu(QWidget *parent) :QMenu(parent) {
    }

    void SmartQMenu::actionUpdate(QAction *action) {
    this->actionEvent(new QActionEvent(QActionEvent::ActionChanged, action));
    }

Similar Threads

  1. Replies: 1
    Last Post: 4th November 2011, 12:25
  2. Toggle text for context menu.
    By phillip_Qt in forum Qt Programming
    Replies: 6
    Last Post: 15th February 2010, 13:29
  3. Context menu for QAction
    By drhex in forum Qt Programming
    Replies: 4
    Last Post: 29th September 2009, 19:01
  4. dropdown menu(popupmenu) refreshing issue
    By Ankit in forum Qt Programming
    Replies: 12
    Last Post: 24th August 2007, 05:57
  5. dropdown menu(popupmenu) refreshing issue
    By Ankit in forum Qt Tools
    Replies: 3
    Last Post: 17th August 2007, 14:09

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.