PDA

View Full Version : Styling a QComboBox



Enygma
22nd August 2007, 19:43
I`m using CSS like:

QComboBox {
border: 1px solid gray;
border-radius: 3px;
}

By using this code the QComboBox gets an unexpected scrollbar, even if it has 3 items... and by selecting the last item... an unwanted and unselectable blank item also apears after the last item.

I will come back tomorrow with code and screenshots.

Any ideea of why this happens? :confused:

Using Qt 4.3.1.

jpn
22nd August 2007, 20:25
This seems to be easy to reproduce with designer preview. It's somehow ironic that this happens with an example from the docs. :)

Enygma
23rd August 2007, 08:08
So... to bug or not to bug? :confused:

jpn
23rd August 2007, 09:00
So... to bug or not to bug? :confused:
To me it looks like a clear bug. Please, send a bug report in case it hasn't yet been reported to the Task Tracker (http://trolltech.com/developer/task-tracker).

Enygma
23rd August 2007, 09:02
Bug filed. ;)

Enygma
23rd August 2007, 09:11
While looking for the bug I submitted ( didn't note down the bug-id :o and now I can't seem to find it :) )... I stumbled upon this one:

http://trolltech.com/developer/task-tracker/index_html?method=entry&id=166534

Could be the solution or just a workaround... need to test it.

Enygma
23rd August 2007, 10:22
Well that helped!

Fixed it by adding something like this:


QComboBox QFrame {
border: 1px solid gray;
}

I guess something got inherited wrong earlier...

Anyway... good to know.