0

I have a problem with the extendedSelection of my QTableView. The Problem is that i have some whitespace around my columns and rows and when i click this whitespace the highlighting of my selected Fields is lost. Its not ocurring when i click somewhere else in my application, only in the whitespace. Also when i set the selection mode to SingleSelection it works just fine.

here is a short gif to illustrate the problem https://gyazo.com/8e4ae161aaff25a4afa1b588579ddd01

thank you everyone who can help me sincerely

solove
  • 1
  • 1

1 Answers1

0

Because that white region belongs to QTableWidget, so when you click that place it resets the selection and selected cell is gone since none of cell is selected. But when you click outside of the QTableWidget, selection state still exists.So If you do not want to this, you can increase column widths like this:

ui.tableWidget->setColumnWidth(columnNumber,columnWidht);

or you can decrease the width of QTableWidget to fit the columns. So user can not see and click this white region.

Wilmort
  • 294
  • 2
  • 15
  • I think it should be possible to do that. Just because in SingleSelection mode it works just fine. But if you think there is really no other way Ok.Either way thank you – solove Sep 03 '15 at 14:54
  • Yes, you can do with SingleSelection mode. I assumed that you do not want to use SingleSelection. So you should do like this if you use other modes. – Wilmort Sep 04 '15 at 05:54
  • i need to use multi selection. But thanks i appreciate it – solove Sep 04 '15 at 13:30