Qss in widget
Hellow!
I have widget and widget set color, for example red, and when this widget include in other widget, for example window, there is no color, but if widget is separate window that all right
I use following qss code
- RSeveralElements
- {
- border: 1 solid rgb(136, 136, 136);
- border-radius: 6px;
- min-height: 20px;
- min-width: 40px;
- stop: 0 #cccccc, stop: 1 #eeeeee);
- }
RSeveralElements heir of QWidget
Advance many thanks for your help!
12 replies
Have a look at this thread. [developer.qt.nokia.com]
I think your situation is similar.
In what widget to you include RSeveralElements?
I was a little hasty with the findings, it work, but it work wrong
This is full qss code after fixed
- RSeveralElements, RSeveralElements *
- {
- border: 1 solid rgb(136, 136, 136);
- border-radius: 6px;
- min-height: 20px;
- min-width: 40px;
- stop: 0 #cccccc, stop: 1 #eeeeee);
- }
- RSeveralWidget, RSeveralWidget *{
- background-color: transparent;
- }
- RSeveralWidget:hover, RSeveralWidget *:hover{
- border: 1 solid #55aaff;
- }
RSeveralElements(parent: QWidget) is widget-panel, where situate QSeveralWidget(parent: QToolButton)
After that create border in RSeveralWidget, but if i remove this
- RSeveralWidget:hover, RSeveralWidget *:hover{
- border: 1 solid #55aaff;
- }
There are no to create
But i need to create border in RSeveralElements
if I understand you well, your initial problem is solved.
Additionally you want a border when hovering over RSeveralWidget. The qss works here. ( it works in my case, I get a blue border when I hover it.)
But for RSeveralElements you don’t get a border when you hover over it? I don’t see the hover part for that one in your example.
You could add RSeveralElements:hover too.
I wish that would border RSeveralElements cover all elements onto RSeveralWidgets
http://hostingkartinok.com/show-image.php?id=29b3ce1c5f18b9ce6fd0329626aad3a8
You must log in to post a reply. Not a member yet? Register here!


