PDA

View Full Version : Hovering over qLineEdit issue



BeautiCode
28th March 2015, 01:39
I just wanted to make a complaint about an issue I'm having.
I set a qLineEdit's stylesheet to make the background black but when I hover over it, it starts glitching and turns the background color white.
The only solution I have is to setFrame(false);
It's the same problem as this guy:
https://forum.qt.io/topic/36399/stylesheet-background-color-bug-in-windows-8-0-8-1/5

jefftee
28th March 2015, 02:02
Have you tried to set the stylesheet to include the hover selector?

Just a guess, but have you tried something like:



m_lineEdit1->setStyleSheet("QLineEdit {background-color:#888888;} QLineEdit:hover {background-color:#888888;}"); //gray

Might need a semicolon after the closing brace for the QLineEdit style. I didn't test this but seems like the hover selector probably comes into play and if its defaults are different than what you are setting for the QLineEdit, it may be the cause, etc.

Hope that helps.

BeautiCode
28th March 2015, 02:28
Problem persists for me, but setFrame is an alright temporary solution for my project.