[Qt-interest] QGraphicsScene isActive method returns wrong value

Frederic Tingaud tingaud at gostai.com
Mon Jul 5 11:26:12 CEST 2010


Hi all,

I have weird behavior with a QGraphicsTextItem in a QGraphicsView. The 
focus cannot be cleared and no focusIn focusOut event occurs since I 
switched from Qt 4.5.2 to Qt 4.6.3, even when setting:
setTextInteractionFlags(Qt::TextEditorInteraction);
setFlag(QGraphicsItem::ItemIsFocusable, true);
I tried to look into the problem and it seems to be due to the fact that 
scene()->isActive() method returns false even though it is active. If I do:
qDebug() << scene()->isActive() << 
scene()->views().first()->isActiveWindow();
the output is "false true" which should not be possible, if I understand 
the documentation correctly.
Do any of you have an idea about what could be happening ?

Regards,

-- 
-------------------------------------------------------------------------------
Frederic TINGAUD
-------------------------------------------------------------------------------




More information about the Qt-interest-old mailing list