c++ - QTableView column width -
i'm struggling set column width manually in qtableview
. why doesn't piece of code work?
tabb = new qtableview; tabb->resizecolumnstocontents(); (int col=0; col<20; col++) { tabb->setcolumnwidth(col,80); }
if omit tabb->resizecolumnstocontents();
still doesn't work.
you should set model first , after able alter columnwidth
:
tabb = new qtableview; tabb->setmodel(somemodel); (int col=0; col<20; col++) { tabb->setcolumnwidth(col,80); }
c++ qt qtableview
No comments:
Post a Comment