Problem with QLineEdit BlinkCursor
I'm trying to redefine QLineEdit as private class - and it's ok
But I want to paint lineEdit with my style, and when I use paintEvent it's work well except Blink cursor... there is no cursor, and there is no text in lineedit box
It's look like text and cursor are hiden behind paint event
Please some one tell me, how I can use paintevent and show normal text and cursor
For example in QSpinBox if I use paintevent the cursor is on his place... so why in lineedit such a problem
What I do wrong?
Check if "this":http://developer.nokia.com/community/wiki/Archived:Creating_a_custom_custom_line_editor_from_QLineEdit helps you.
[quote author="p3c0" date="1411024877"]
Check if "this":http://developer.nokia.com/community/wiki/Archived:Creating_a_custom_custom_line_editor_from_QLineEdit helps you.[/quote]
Thanks for your help !
But you see, from that manual, the paintevent starts only when text line is empty. So when lineedit has a focus - paintevent (from app code) doesn't start.
In my case I try to paint the whole lineedit area, so my paintevent code is working during the whole app loop... and there is still no cursor and no text (((
I'm starting to think that the only solution is to write code to repaint the Blink cursor by myself
Hi and welcome to devnet,
If it's a style question, why not implement your own based on e.g. QStyle ?
[quote author="SGaist" date="1411030922"]If it's a style question, why not implement your own based on e.g. QStyle ?[/quote]
damn you're right... and I so wanted to be a Qt jedi, painting widgets by myself
Well technically that's what you will do, it's the style that paints some of the widget :)
Don't be too hasty young Padawan ;)