PDA

View Full Version : QTabWidget stylesheet



GuS
5th December 2007, 01:11
Hi guys!

I am having a weird minor issue when i use stylesheet on QTabWidget which was not happening in Qt4.3.0 (Currently using Qt4.3.2).

Lets see the example: http://opencoffee.lnxteam.org/downloads/pub/pics/OpenCoffee-Server_Client.png

Look at the main window, the first tab which is named "Información": the first and the last letter does not show correctly on the tab, but it does when i am in positioned in that current tab.
Now, only happens with the first one, lets say with a more larger word tab, does not happen. Example, with the last tab named "Administración" as you can see.

This is my stylesheet code:

QTabWidget, QStackedWidget {background: none}
QTabWidget:tab-bar { left: 0.3em;}
QTabWidget:pane {
border: 0px;
top: 0.1em;
border-image: url(:/Styles/styles/tabBg.png);
background-repeat: no repeat;}
QTabBar:tab {
background-image: url(:/Styles/styles/tabBarBg.png);
border: 1px solid #7a7a7a;
border-bottom-color: #ffffff;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
padding: 2px 6px 2px 6px;}
QTabBar:tab:selected, QTabBar:tab:hover {
background-image: url(:/Styles/styles/tabBarBg_hover.png);
}
QTabBar:tab:!selected { margin-top: 2px;}
QTabBar:tab:selected {
margin-left: -4px;
margin-right: -4px;
}
QTabBar:tab:first:selected { margin-left: 0;}
QTabBar:tab:last:selected { margin-right: 0;}
QTabBar:tab:only-one { margin: 0;}

Any tip?

Thanks!!

Cheers.

wysota
5th December 2007, 08:55
Have you tried using QTabBar::tab:first { ... } ? You could change a margin or enforce a minimal width.

GuS
6th December 2007, 23:03
Have you tried using QTabBar::tab:first { ... } ? You could change a margin or enforce a minimal width.

Yeah I could do that, but that was not my question... why does now fails and before not? and why occurs in the first tab and not in the others? :)

I just did min-width: 10ex; in the hole tab stylesheet... but i was wondering what happen and why... should work as i have i think...

Thanks.

Cheers.

wysota
6th December 2007, 23:31
Maybe some "bug" was "corrected" or a bug was corrected :)