PDA

View Full Version : QToolButton icon not updated in overflow menu



pabakertx
25th September 2007, 22:42
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.,


if (state_ == Qt::Checked || state_ == Qt::PartiallyChecked) {
state_ = Qt::Unchecked;
}
else {
state_ = Qt::Checked;
}
QAction *a = defaultAction();
if (a) {
a->setIcon(icon_[state_]);
}

Note that the icon does get updated eventually, when the toolbar becomes visible again.

Is this a known bug in Qt4.2?

wysota
25th September 2007, 22:51
You can check that with the task-tracker (http://www.trolltech.com/developer/task-tracker).

pabakertx
26th September 2007, 13:48
I posted it to Trolltech as #180626, but I also found it as resolved in Qt 4.3 under bug #118546.