i'm having n number of rows in table.
My problem is :
1.When the user selects one row from table, the row color should be changed to xyz color.
How can this be done?
i'm having n number of rows in table.
My problem is :
1.When the user selects one row from table, the row color should be changed to xyz color.
How can this be done?
if itemClicked
set all items color to default
set the clicked item's color to xyz
thanks for replying.
my problem is , first user selects 2row then its' color should be changed.
After selecting 2nd row, user can select 10 row, so 2nd & 10th row will have same color.
Ok, then set the table to accept multi selection additionaly. Is that what you want?
another problem is when the item is clicked,there is confirm button.
on clicking confirm we have to change it's color.
Also is there any property of mutli-selection in table widget ?
Sure, you can set the property from the designer.
i have set the mutli-selection property from Designer.
But i'm not able to change the color of the selected row.
can u just give snippets of code or any link where such problem has been solved?
well it should be something like;
Qt Code:
connect( yourTableWidget, SIGNAL(itemClicked(Item*)), this, SLOT(itemClickedSlot(Item*))); ... void itemClickedSlot(Item* myItem) { for each item in the table widget item item->setStyleSheet("background-color:rgb(white/default color)"); myItem->setStyleSheet("background-color:rgb(clickedcolor)"); }To copy to clipboard, switch view to plain text mode
Bookmarks