[BUG] Scroll bar erases border set with Qt style sheets
-
Actually it seems more like a bug but maybe I just do something wrong.
Here is the code:
@#include <QtGui/QApplication>
#include <QtGui/QPlainTextEdit>int main(int argc, char *argv[])
{
QApplication a(argc, argv);QPlainTextEdit e; e.setStyleSheet("QPlainTextEdit { border: 1px solid palette(dark); }");
// e.setStyleSheet("border: 1px solid palette(dark)"); works with same effect
e.show();return a.exec();
}@
If you try to resize window or let it loose focus you will see this (as seen on Windows 7):
<br>
!http://img835.imageshack.us/img835/8707/scrollbarissue1.png(Yep, it's erased, I mean border.)!Do I need to change my code or file a bug report?
UPDATE: looks like it's a bug. "Link to bug report":https://bugreports.qt.nokia.com/browse/QTBUG-20672
-
At first sight I tought it had something to do with the paint "coordinate system":http://developer.qt.nokia.com/doc/qt-4.7/coordsys.html#id-51ea41fc-6e51-44fe-9059-0d49988c6b35.
But then I tried your code with 10px and the part of the borderline under the scrollbar becomes white. Also if you do that with other border widths you get the same. I'm not sure what can cause this. Altering the height of the window up and down on the twilight zone where a scrollbar is needed or not shows the scrollbar is responsible for this painting of the border.
Please, file a bug report on this on the "bug tracker":https://bugreports.qt.nokia.com.
-
You know, I'm amazed. I first found this in Qt 4.6 but I thought it was my fault, cause nobody on the internet reported that.
Will be done in no time.
-
[quote author="evergreen" date="1312183435"]That doesn't seem clear to me.
Could you explain what you expect to see and what is wrong in the picture?[/quote]I expected to see border under the scrollbar to be of palette(dark) color but not white.
Even if I try to get screenshot for expected state, window looses it's focus, and... You've got the idea. -
[quote author="chernetsov0" date="1312200874"]You know, I'm amazed. I first found this in Qt 4.6 but I thought it was my fault, cause nobody on the internet reported that.
Will be done in no time.[/quote]
That's because you need the eyes of an eagle to see it.
Could you put the link to the bugreport page here? Also, If you add a link to this topic in the bug report, it wil be easier for the developers to understand the issue.
Thanks
-
[quote author="Eddy" date="1312209416"]
That's because you need the eyes of an eagle to see it.
[/quote]It was kind of obvious for me. When you messing around with widget styles this is kind of issues you are looking for, right?
"Link to bug report":https://bugreports.qt.nokia.com/browse/QTBUG-20672
-
Not sure if you've figured this out but you should be able to fix this by changing the frameShape setting of the widget. For example, for QPlainTextEdit make sure the frameShape is set to "NoFrame" and then you can use this styling:
@
QPlainTextEdit
{
border: 2px solid #c0c0c0;
border-radius: 8px;
padding:2px;
}
@
If you leave frameShape as "StyledPanel" the scrollbar overlaps the border for some reason.[Edit: Added @ tags around code; mlong]