Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 4

Qt-interest Archive, June 2007
setEnabled() and setVisible() in QAction


Message 1 in thread

Hello,
Is this intentional (I guess so by looking at QAction::setEnabled() code) ? :

<code>
QAction *a = ...

// a is enabled here
//...

a->setVisible(false);

// a is disabled here

a->setVisible(true);

// a is still disabled here
</code>

I remember in Qt3 visibility was somewhat independent of 'enabled' flag. Is 
Qt4 behaviour new and intentional? If so, wouldn't some API docs in relevant 
methods save some time for users of Qt?
I mean "setVisible(false) automatically disables the action".

Anyway, to avoid the problems, while porting from Qt3 I am moving from 
setVisible() to full recreating of the popup menus when needed.

-- 
 [ signature omitted ] 

Message 2 in thread

Jaroslaw Staniek wrote:

> 
> Hello,
> Is this intentional (I guess so by looking at QAction::setEnabled() code)
TrollTech says: yep, this is a feature.

Best regards
Christoph

--
 [ signature omitted ]