PDA

View Full Version : How to set style sheet for stackwidget



mekalapandiyan@gmail.com
13th May 2013, 12:06
In my Application, i have one stackedwidget, in the first page , i have table widget.
i want set style sheet for tablewidget headerview,
but, i can't able to set the qstackedwidget style sheet.

i have tried as follows,

this->setStyleSheet( " QHeaderView::section {"
" background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,"
" stop:0 #616161, stop: 0.5 #505050,"
" stop: 0.6 #434343, stop:1 #656565);"
" color: white;"
" padding-left: 4px;"
" border: 1px solid #6c6c6c;"
"}"
);


this->setStyleSheet( " QStackedWidget QWidget#page {"
"QHeaderView::section {"
" background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,"
" stop:0 #616161, stop: 0.5 #505050,"
" stop: 0.6 #434343, stop:1 #656565);"
" color: white;"
" padding-left: 4px;"
" border: 1px solid #6c6c6c;"
"}"
"}"
);

Santosh Reddy
13th May 2013, 12:23
Use any one of the following



this->setStyleSheet( " QTableWidget#tableWidget"
"QHeaderView::section {"
" background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,"
" stop:0 #616161, stop: 0.5 #505050,"
" stop: 0.6 #434343, stop:1 #656565);"
" color: white;"
" padding-left: 4px;"
" border: 1px solid #6c6c6c;"
"}"
);



this->setStyleSheet( " QWidget#page"
"QHeaderView::section {"
" background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,"
" stop:0 #616161, stop: 0.5 #505050,"
" stop: 0.6 #434343, stop:1 #656565);"
" color: white;"
" padding-left: 4px;"
" border: 1px solid #6c6c6c;"
"}"
);



this->setStyleSheet( " QStackedWidget#stackedWidget"
"QHeaderView::section {"
" background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,"
" stop:0 #616161, stop: 0.5 #505050,"
" stop: 0.6 #434343, stop:1 #656565);"
" color: white;"
" padding-left: 4px;"
" border: 1px solid #6c6c6c;"
"}"
);