| ID | ... | Creation date | 06 January 2009 |
| Platform | S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition | Tested on devices | Emulator |
| Category | Qt for Symbian | Subcategory | Stylesheet |
| Keywords (APIs, classes, methods, functions): stylesheet, Push Button, Text Label |
This code snippet demonstrates how to create a stylesheet using a Qt designer in Carbide 2.0 . Advantage of using Qt designer is that it shows the preview as soon as you change the style. When you apply a style to a window or application the style will affect all the widget in application.
file->new->Qt project->GUI Widget
QPushButton {
border: 2px solid #8f8f91;
border-radius: 6px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #f6f7fa, stop: 1 #dadbde);
min-width: 80px; }
QLineEdit {
border: 2px solid gray;
border-radius: 10px;
padding: 0 8px;
background: yellow;
selection-background-color: darkgray;
}
QFrame
{
border: 2px solid green;
border-radius: 4px;
padding: 2px;
background-color: rgb(125,125,30);
}