QToolButton * tb = new QToolButton;
tb->setAutoRaise(true);
tb->setDefaultAction(action);
+ QToolButton * pb = qobject_cast<QToolButton *>(parentWidget());
+ tb->setIconSize(pb->iconSize());
// trigger tooltip (children of popups do not receive mousemove events)
tb->setMouseTracking(true);
}
-void IconPalette::updateParent()
-{
- bool enable = false;
- // FIXME: so this is commented out for speed considerations
- // true fix is to repair the updating mechanism of the toolbar
-#if 0
- for (int i = 0; i < actions_.size(); ++i)
- if (actions_.at(i)->isEnabled()) {
- enable = true;
- break;
- }
-#else
- // we check only the first action to enable/disable the menu
- if (actions_.size() > 0)
- enable = actions_.at(0)->isEnabled();
-#endif
-
- parentWidget()->setEnabled(enable);
-}
-
-
void IconPalette::paintEvent(QPaintEvent * /*event*/)
{
// draw border
}
#else
// we check only the first action to enable/disable the menu
- if (actions_.size() > 0)
+ if (!actions_.isEmpty())
enable = actions_.at(0)->isEnabled();
#endif