PDA

View Full Version : how to add a image to table column header



nageshvk
8th November 2010, 12:44
hi

I need to add a image to the table column header. When user sorts data based on particular column...i want to show a image on the sorted column.

And also want to know how to increase the cell size in a table.

Regards
Nagesh

somnathbanik
8th November 2010, 13:12
to display image you can simply use Label

ChrisW67
9th November 2010, 03:13
You also can style the sort indicator using a style sheet and the QHeaderView ::up-arrow, and ::down-arrow sub-controls.

abhiabcl
25th December 2010, 14:34
tableWidget1->setStyleSheet(QString::fromUtf8("QHeaderView::section\n"
"{\n"
"border-image: url(:/new/prefix1/timebar11.PNG);\n"
"}"));
//tableWidget1->setHorizontalHeaderItem(0, new QTableWidgetItem("Text", QTableWidgetItem::UserType));