G'day all
How can i set the background color in lineEdit, textEdit, ect to
red. then how to make it a flashing red...
thanks in anticipation
briang
G'day all
How can i set the background color in lineEdit, textEdit, ect to
red. then how to make it a flashing red...
thanks in anticipation
briang
I use stylesheet property in QtCreator. The flash effect you could probably do with a timer.
ps: googling 'set background QLineEdit' resulted in some decent examples
briang (23rd October 2009)
hey brian, there are couple of ways to do, it all depends on what exactly you need to style.
My experience is using Qt Designer, so if you are familiar with it thats' great - if you aren't, then its a great opportunity for you to have a look at it.
If its for instance to style all QLineEdits and and QTextEdit, open designer...
1. create the UI as needed
2. Right-Click on the top-level object
3. Once you right click, a "set stylehsheet" option should appear
4. just write
".QLineEdit, .QTextEdit
{
background-color: red;
}"
5. and thats it!(images attached for further guidance)
Note: adding the "." before the object name as i did, will make the style to be applied universally to every QLineEdit(or whatever object you choose) in the UI .
thanks,
briang (6th November 2009)
If you're not using the gui builder, you can do the following:
Qt Code:
edit->setPalette(p);To copy to clipboard, switch view to plain text mode
Look at the documentation for QPalette too.
Last edited by smacchia; 5th November 2009 at 17:31.
briang (6th November 2009)
Bookmarks