Strange header like boxes in front of every table row
-
wrote on 24 Jul 2024, 14:32 last edited by
Hi,
I already searched using different phrases and prompts but I could not find anyone else who already described the visual issue that I have with QTableView. This is why I am writing here in the hopes of someone that might know a simple solution to my issue.
The issue is that I have strange boxes in front of every table row, but only if there are rows in the table. The boxes look kind of like the column headers. With their border they are only 2 pixels wide. However, it looks funky and I would rather not have these boxes there. Is there something analogous of column headers but for rows that is enabled by default? I did not configure that QTableView specially in this regard.
Please find these two screenshots indicating the different appearances:
Any help would be appreciated. Thanks
Regards,
Sebastian -
Hi,
I already searched using different phrases and prompts but I could not find anyone else who already described the visual issue that I have with QTableView. This is why I am writing here in the hopes of someone that might know a simple solution to my issue.
The issue is that I have strange boxes in front of every table row, but only if there are rows in the table. The boxes look kind of like the column headers. With their border they are only 2 pixels wide. However, it looks funky and I would rather not have these boxes there. Is there something analogous of column headers but for rows that is enabled by default? I did not configure that QTableView specially in this regard.
Please find these two screenshots indicating the different appearances:
Any help would be appreciated. Thanks
Regards,
Sebastianwrote on 24 Jul 2024, 15:12 last edited by@sebastianzander those are row headers. Empty and visible, since - like you said - not configured.
Please try something along this line:
ui->tableView->verticalHeader->setVisible(false);
Alternatively if you dive into the design view you'll see in the inspector property "Vertical header visible" checked. -
Hi,
I already searched using different phrases and prompts but I could not find anyone else who already described the visual issue that I have with QTableView. This is why I am writing here in the hopes of someone that might know a simple solution to my issue.
The issue is that I have strange boxes in front of every table row, but only if there are rows in the table. The boxes look kind of like the column headers. With their border they are only 2 pixels wide. However, it looks funky and I would rather not have these boxes there. Is there something analogous of column headers but for rows that is enabled by default? I did not configure that QTableView specially in this regard.
Please find these two screenshots indicating the different appearances:
Any help would be appreciated. Thanks
Regards,
Sebastianwrote on 24 Jul 2024, 15:04 last edited by@sebastianzander said in Strange header like boxes in front of every table row:
I did not configure that QTableView specially in this regard.
Please show how you add the data and what model is used.
Your platform/system? Qt version?
-
Hi,
I already searched using different phrases and prompts but I could not find anyone else who already described the visual issue that I have with QTableView. This is why I am writing here in the hopes of someone that might know a simple solution to my issue.
The issue is that I have strange boxes in front of every table row, but only if there are rows in the table. The boxes look kind of like the column headers. With their border they are only 2 pixels wide. However, it looks funky and I would rather not have these boxes there. Is there something analogous of column headers but for rows that is enabled by default? I did not configure that QTableView specially in this regard.
Please find these two screenshots indicating the different appearances:
Any help would be appreciated. Thanks
Regards,
Sebastianwrote on 24 Jul 2024, 15:12 last edited by@sebastianzander those are row headers. Empty and visible, since - like you said - not configured.
Please try something along this line:
ui->tableView->verticalHeader->setVisible(false);
Alternatively if you dive into the design view you'll see in the inspector property "Vertical header visible" checked. -
@sebastianzander said in Strange header like boxes in front of every table row:
I did not configure that QTableView specially in this regard.
Please show how you add the data and what model is used.
Your platform/system? Qt version?
wrote on 25 Jul 2024, 06:26 last edited by@artwaw said in Strange header like boxes in front of every table row:
@sebastianzander those are row headers. Empty and visible, since - like you said - not configured.
Please try something along this line:
ui->tableView->verticalHeader->setVisible(false);
Alternatively if you dive into the design view you'll see in the inspector property "Vertical header visible" checked.Thank you very much, Artur. You were right, the thing is that in our company we use a special class that inherits from
QTableView
and this class uses the vertical header to configure screen and DPI dependent row heights. I guess without those settings it would not even display those "strange boxes".Many windows in our software explicitly set
verticalHeader->setVisible(false)
orverticalHeader->hide()
in their constructors, so it seemed odd to me that other tables do not have these vertical header boxes.I will suggest a change to our special
QTableView
descendant so that it callsverticalHeader->hide()
in its constructor.@Pl45m4, thank you, too. I should have written that I use a descendant of
QTableView
, because so I (our company to be exact) indeed configureQTableView
andQHeaderView
specifically in this regard.Once again, many thanks to both of you for your quick replies and help.
Kind regards,
Sebastian -
1/4