I'm working on a project that has a lot of tables. I used QTableWidget. Horizontal headers are visible, verticals are hiddden. I wrote style sheet for one of them, rest of them are just copied from that one. In Qt Designer, everything is alright, but when I run the program, there's not headers on QTableWidgets. I checked horizontalHeaderVisible property of every tables, it checked. I don't know why this is happening. It seems bug to me.
Asked
Active
Viewed 148 times
0
-
if you remove the stylesheet, can you see the headers of the tables??? – ΦXocę 웃 Пepeúpa ツ Jun 30 '21 at 12:10
-
1can you please post the code? – ΦXocę 웃 Пepeúpa ツ Jun 30 '21 at 12:10
-
I tested my program. In Qt creator, it shows headers, ok. In constructor of form's class, I wrote this code after setting up UI: `qInfo() << ui->tableWidget->horizontalHeader()->isVisible();` and it shows false. Then I changed headers visibility in my code, now works. I think that's bug of qt creator, I'm using v4.13.1 – Abdurahmon Jun 30 '21 at 12:19
-
@Abdurahmon please provide a [mre] – eyllanesc Jun 30 '21 at 13:00
-
I just put QTableWidget using Qt designer. Then I created headers, applied style sheet for them. Then I just copied the table many times. But headers were not visible as there were in qt designer. – Abdurahmon Jul 01 '21 at 11:23
1 Answers
0
I'm using Qt creator v4.13.1. In designer, everything is ok as I said. Then I opened all .ui files in notepad, and searched for horizontalHeaderVisible
property. Of course there were many false
values as I expected, then I changed them to true. Then headers became visible. It seems bug of Qt creator.

Abdurahmon
- 148
- 1
- 9