QTableWidget美化方法

 

QTableWidget* table = new QTableWidget(3,4,this);
table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
table->setFixedSize(640,480);
//verticalHeader
table->verticalHeader()->setStyleSheet
("QHeaderView::section {background-color:darkcyan;"
"color: red;padding-left: 4px;border: 1px solid #6c6c6c;}");
//horizontalHeader
table->horizontalHeader()->setStyleSheet
("QHeaderView::section {background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,"
"stop:0 #616161, stop: 0.5 yellow,stop: 0.6 green, stop:1 cyan);"
"color: white;padding-left: 4px;border: 1px solid #6c6c6c;}"
"QHeaderView::section:checked{background-color: red;}"
"QHeaderView::down-arrow {image: url(down_arrow.png);}"
"QHeaderView::up-arrow {image: url(up_arrow.png);}");
table->move(10,10);
table->show();

你可能感兴趣的:(c,image,table,url,UP)