PDA

View Full Version : QTabBar stylesheet references (changing base color)



NoMa
22nd March 2011, 09:40
Hello,

first time i post here, nice to meet you everyone.

I am working on a MDI, and I use a QTabBar to switch between documents.

I want to change the style of the tabbar, and I use stylesheets for that.
Customisation of the tabs is not a problem, but I can't find the subcontrol or the property to change the color of the bar at the bottom of the tabbar widget.

What I currently have :
6121

What I want to do :
6120

high_flyer
22nd March 2011, 09:53
hmm.. I'd try QTabWidget ::pane :top or something along these lines.

NoMa
22nd March 2011, 13:32
hmm.. I'd try QTabWidget ::pane :top or something along these lines.

I did try many things like that w/o success ... but it's like an errand, i don't find many infos on the subject.

Isn't there an exhaustive list of sub-controls and parameters for all QT classes ?

(At least for QTabBar atm ;) )

high_flyer
22nd March 2011, 14:01
Isn't there an exhaustive list of sub-controls and parameters for all QT classes ?
Sure there is:
http://doc.qt.nokia.com/latest/stylesheet-reference.html

But I still find it not always quite clear what is what, so I just try.

NoMa
22nd March 2011, 14:06
Sure there is:
http://doc.qt.nokia.com/latest/stylesheet-reference.html

But I still find it not always quite clear what is what, so I just try.

Yeah I know this link, but it is not exhaustive, I am not sure there is all the subcontrols for each class. It seems that it shows the most ofently used ones.
I am trying to find the properties that interest me in the QTDesigner, I'll put here what i find. (I must yet find how to add a QTabBar in QTDesigner, I only see Tab Widget lol).

high_flyer
22nd March 2011, 14:41
ut it is not exhaustive, I am not sure there is all the subcontrols for each class.
AFAIK this is the best you can get, and it does list everything - after all, this is the official Qt Style sheet reference.
If there are things not documented, its because they are not supposed to be used.

But post if you find the answer to your question, so others may be helped by it.

NoMa
22nd March 2011, 15:21
AFAIK this is the best you can get

I am affraid it is ...

I'll post what i find here, but I can't insert a QTabBar in the designer ... thx for the help anyway

high_flyer
22nd March 2011, 15:38
but I can't insert a QTabBar in the designer
but you can A QTabWidget which has a QTabBar.

NoMa
22nd March 2011, 15:47
yes, but with a QTabWidget I can't find the parameters of the QTabBar.

high_flyer
22nd March 2011, 15:51
Not sure what you mean - but you can set a stylesheet, and reference in it QTabBar and all its sub components and see the changes on the fly.

NoMa
24th March 2011, 09:27
Ok ... sorry for the trouble, a colleague did a "drawrect" kinda hided in the code, and I had to deactivate all the widget one by one to find what it was ...

high_flyer
24th March 2011, 09:31
Can you show the stylesheet for styling the line you wanted?

NoMa
24th March 2011, 09:37
It was a dumb rect. I'm deactivating it.
I think the best solution is to play with the bottom margin or border of my QDockWidget.

I'll post the stylesheet when i'm done.

NoMa
4th April 2011, 09:49
Ok, I couldn't solve this with stylesheet.

In fact there is a gap in the QMainWindow between the Docks Widgets and the Central Widgets, I couldn't manage to reduce it, so I did it drawing a rec behing the widgets ... sounds crap to me, but I hope I will find a better solution later.