Currently when the tableview is empty, the horizontalheader will be automatically hidden. But I want it always shown. Is there anyway to do that?
Currently when the tableview is empty, the horizontalheader will be automatically hidden. But I want it always shown. Is there anyway to do that?
did you try:
pMyTable->horizontalHeader()->setVisible(true); ?
Last edited by high_flyer; 29th June 2010 at 09:28.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
yeah, but it has no effect.
Can you show your code?
Is the table generated in code, or designer?
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Sorry, I cannot show my code.
The table is generated by code, and it's totally following the model/view architecture. Basically it looks lke this:
class A: public QAbstractTableModel{...};
class B: pulbic QSortFilterProxyModel{...};
class C: public QTableView{...};
A a;
B b;
C c;
b.setModel(&a);
c.setModel(&b);
Here c is the table. Everything just works fine, except that the horizontalHeader of c automatically disappears when I hide all columns in c. I just want the horizontalHeader always shown.
This is not the same as:when I hide all columns in c
Hidden is not same as empty.Currently when the tableview is empty
You probably will have to manually call showSection() on the hidden columns,when you hide you columns.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks