How to get reverse rounded corners for QTabWidget using stylesheets?
I want to get the tab look and feel provided by the latest version of Opera i.e. Opera 10. Here's a screenshot of Opera 10 tabs (it may be same in Opera 9 too):
http://img134.imageshack.us/img134/7109/operatabs.png
As you can see, there is some space between the tabs and the corners of tabs are rounded. In addition the rounded corners at the bottom left and bottom right of the tabs are reverse i.e. they are inclined out.
I modified the tabdialog example of Qt and came up with this:
http://img134.imageshack.us/img134/652/tabsv.png
I am using the following style sheet for the above look:
Code:
border-top: 6px solid qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #FFE085, stop: 0.8 #CC9900); /* Width of the line below the tab panel */
}
left: 5px; /* move to the right by 5px */
}
/* Tab properties */
border: 1px solid #000000;
border-top-left-radius: 4px; /* For rounded corners */
border-top-right-radius: 4px;
min-width: 8ex;
padding: 2px; /* Padding inside each tab */
margin-left: 4px; /* Margins among the tabs */
margin-right: 4px;
}
/* Properties for selected tab */
background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #CC9900, stop: 0.8 #FFE085);
border-color: #000000;
border-bottom-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #CC9900, stop: 0.8 #FFE085); /* same as pane color */
}
/* Properties for unselected tabs */
background: #C2C7CB; /* Gray color for unselected tabs */
border-bottom-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #CC9900, stop: 0.8 #FFE085); /* same as pane color */
margin-top: 4px; /* make non-selected tabs look smaller */
}
margin-left: 0; /* the first selected tab has nothing to overlap with on the left */
}
margin-right: 0; /* the last selected tab has nothing to overlap with on the right */
}
As you can see, i was able to put some space between the tabs and also got rounded corners. Now, i don't know how to get the reverse rounded corners at the bottom left and bottom right like the Opera tabs.
Anybody has a clue?
Re: How to get reverse rounded corners for QTabWidget using stylesheets?
does anybody knows about it? I am pretty sure that there's a way since Opera (written in Qt) is doing it.
Re: How to get reverse rounded corners for QTabWidget using stylesheets?
May be they have subclassed the headerview :rolleyes:
Re: How to get reverse rounded corners for QTabWidget using stylesheets?
If you want to use style sheets then you could simply use images. For right scaling look in the docs for "QPushButton and images".
Re: How to get reverse rounded corners for QTabWidget using stylesheets?
i was thinking of using images for tabs. Looks like there is no other way of doing this through style sheets.
Thanks for the help!
Re: How to get reverse rounded corners for QTabWidget using stylesheets?
How we can create a style sheet in Visual Studio ?
Re: How to get reverse rounded corners for QTabWidget using stylesheets?
Quote:
Originally Posted by
Peter_APIIT
How we can create a style sheet in Visual Studio ?
you can create/write a style sheet in any editor i..e Visual Studio, Notepad etc.
it's just a text file.