Solved Select QGraphicsObject when QTextEdit got clicked
-
I have a
QGraphicsObject
with aQTextEdit
on top of it thoughtQGraphicsProxyWidget
,
I want theQGraphicsObject
get selected when clicked on theQTextEdit
. -
Why dont you connect them?!
If your
QTextEdit
hasFocus
(https://doc.qt.io/qt-5/qwidget.html#focus-prop), select yourQGraphicsObject
(https://doc.qt.io/qt-5/qgraphicsitem.html#setSelected)
(SetQGraphicsItem::ItemIsSelectable
flag first) -
Thanks, I just needed an event filter to detect focus changes.