Hi all
I have a QGraphicsTextItem that is editable. I want to assign a validator to it when I edit the contents. I know how to do it for a QLineEdit.
can anyone guide me how to use it for QGraphicsTextItem?
Thanks
Arjun
Hi all
I have a QGraphicsTextItem that is editable. I want to assign a validator to it when I edit the contents. I know how to do it for a QLineEdit.
can anyone guide me how to use it for QGraphicsTextItem?
Thanks
Arjun
There is no such default functionality in QGraphicsTexItem. But you can add it to it.
You'll have to work directly with the QTextDocument provided by QGraphicsTextItem::textDocument().
You can connect to QTextDocument::contentsChanged signal and do all the validation in there, either using a standard or costom QValidator.
Regards
Even i do need such a functionality in my app but busy with something else at the moment. If you are able to achieve this, can you share your idea(or if possible code) please ?
The biggest difference between time and space is that you can't reuse time.
-- Merrick Furst
BTW currently i am validating text in the focusOutEvent() of the text item. I am not using any of QValidators for now.
Sorry , forgot to post this in my previous post
The biggest difference between time and space is that you can't reuse time.
-- Merrick Furst
Sure. Once I have something I will post it.
Arjun
Bookmarks