IconAction refuses to display and to be activated if the underlying QAction is invisible or disabled

svn path=/trunk/KDE/kdelibs/; revision=1072708
This commit is contained in:
Marco Martin 2010-01-10 19:34:33 +00:00
parent 1aac8cb293
commit 8ee524d172

View File

@ -225,6 +225,10 @@ void IconAction::rebuildPixmap()
bool IconAction::event(QEvent::Type type, const QPointF &pos)
{
if (!m_action->isVisible() || !m_action->isEnabled()) {
return false;
}
if (m_icon->size().width() < m_rect.width() * 2.0 ||
m_icon->size().height() < m_rect.height() * 2.0) {
return false;
@ -289,6 +293,10 @@ QAction *IconAction::action() const
void IconAction::paint(QPainter *painter) const
{
if (!m_action->isVisible() || !m_action->isEnabled()) {
return;
}
if (m_icon->size().width() < m_rect.width() * 2.0 ||
m_icon->size().height() < m_rect.height() * 2.0) {
return;