Results 1 to 3 of 3

Thread: QToolButton icon not updated in overflow menu

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QToolButton icon not updated in overflow menu

    I have a QToolBar with several QToolButtons that change state (and icon) when clicked. This works just fine when the toolbar is visible. However, when the window is shrunk such that the toolbar becomes an "overflow" menu (accessible via the chevron icon >>), the icons do not get updated in the menu. E.g.,

    Qt Code:
    1. if (state_ == Qt::Checked || state_ == Qt::PartiallyChecked) {
    2. state_ = Qt::Unchecked;
    3. }
    4. else {
    5. state_ = Qt::Checked;
    6. }
    7. QAction *a = defaultAction();
    8. if (a) {
    9. a->setIcon(icon_[state_]);
    10. }
    To copy to clipboard, switch view to plain text mode 
    Note that the icon does get updated eventually, when the toolbar becomes visible again.

    Is this a known bug in Qt4.2?
    Last edited by jacek; 25th September 2007 at 23:57. Reason: changed [html] to [code]

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
  •  
Qt is a trademark of The Qt Company.