Re: Blink Text in QTextEdit
Blinking text! The early 90s called and want their blinking text back.
Quote:
I tried using a timer and signal-slot connection. It works fine.
So, you have a solution, but I cannot think of anything more annoying (in a UI) than trying to edit text that is blinking. There is no setBlinkingText() function if that is what you are looking for.
Re: Blink Text in QTextEdit
Thanks Chris! But, I wont be editing the text. I'm just using the QTextEdit class to display the text. So, would you recommend the timer-signal-slot method as the apt solution?
Re: Blink Text in QTextEdit
Yes, subclass QTextEdit/QLabel and give your subclass a setFlashRate() and set a timer based on that (zero might be don't flash) or similar and you should be good to go.
Re: Blink Text in QTextEdit
hi,
Quote:
Thanks Chris! But, I wont be editing the text. I'm just using the QTextEdit class to display the text.
Then you can use QLabel instead of using QTextEdit.
Yes timer is the simple way to implement blink
hope it helps,
bala
Re: Blink Text in QTextEdit
hi chris i am unable to find setflashrate() in Qlabel/QtextEdit i am using qt-4.8.2 if it is possible to scroll text in Qlabel plz update us .....
Re: Blink Text in QTextEdit
Quote:
Originally Posted by
pradeepreddyg95
hi chris i am unable to find setflashrate() in Qlabel/QtextEdit i am using qt-4.8.2 if it is possible to scroll text in Qlabel plz update us .....
This is a method one is supposed to implement first.
Re: Blink Text in QTextEdit
Re: Blink Text in QTextEdit
Hi Chris... The blink feature works fine for me. But, the characters occupy varying number of pixels. This makes the blink imperfect. Is there any way to set the pixel size uniformly for all the characters (including a blank space). I tried setPixelSize under QFont class... but I don't get the expected result. Could you please help me with this?
Re: Blink Text in QTextEdit
Have you tried with setCursorWidth() ?
Re: Blink Text in QTextEdit
Yes I have tried it. But that changes only the width of the cursor. I want to set the pixel width for the characters.
Re: Blink Text in QTextEdit
Re: Blink Text in QTextEdit
Thanks Gokul. QFontMetrics class has options only to read the properties of the font. It seems there is no way to set the font properties using this class.
Re: Blink Text in QTextEdit
Quote:
Originally Posted by
Vaishnavi
Hi Chris... The blink feature works fine for me. But, the characters occupy varying number of pixels. This makes the blink imperfect. Is there any way to set the pixel size uniformly for all the characters (including a blank space). I tried setPixelSize under QFont class... but I don't get the expected result. Could you please help me with this?
Use a fixed width font (e.g. Courier) instead of a proportional one (e.g. Arial).
Re: Blink Text in QTextEdit
Thanks. I have tried this. It doesn't work yet :(
Re: Blink Text in QTextEdit
Quote:
Hi Chris... The blink feature works fine for me. But, the characters occupy varying number of pixels. This makes the blink imperfect.
:confused: By blink you mean alternating draw text, don't draw text. How does font size have anything to do with this?
Re: Blink Text in QTextEdit
My requirement is as mentioned below.
I have a string : "Welcome Good Morning".
I want only the word "Good" to keep blinking. I'm successful in achieving this. I have done some string manipulations for this.
While making the text to blink, the word "Good" appears and disappears alternatively. When it disappears, the 4 characters(G,o,o,d) are replaced by 4 blank spaces. In this case, the no.of pixels occupied by a blank space and the no. of pixels occupied by other characters do not seem to match. Hence the appearance is not as expected. The text appears to be moving while blinking. I would like to resolve this issue. I believe this could be resolved if the pixel size for all the characters is set to the same value. I request your help to obtain an appropriate solution.
Re: Blink Text in QTextEdit
as already mentioned, using a fixed-space font should resolve that issue.
Re: Blink Text in QTextEdit
I tried Courier. But it doesn't impose much effect.
Added after 9 minutes:
I tried again. Courier works fine. Thanks to all :)