mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use setSectionResizeMode if we use Qt5
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
abfd86af59
commit
5ff961b033
1 changed files with 12 additions and 2 deletions
|
@ -219,9 +219,14 @@ QTableView *PrintLayout::createProfileTable(ProfilePrintModel *model, const int
|
||||||
table->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
table->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
table->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
table->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
hHeader->setVisible(false);
|
hHeader->setVisible(false);
|
||||||
hHeader->setResizeMode(QHeaderView::Fixed);
|
|
||||||
vHeader->setVisible(false);
|
vHeader->setVisible(false);
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
|
hHeader->setResizeMode(QHeaderView::Fixed);
|
||||||
vHeader->setResizeMode(QHeaderView::Fixed);
|
vHeader->setResizeMode(QHeaderView::Fixed);
|
||||||
|
#else
|
||||||
|
hHeader->setSectionResizeMode(QHeaderView::Fixed);
|
||||||
|
vHeader->setSectionResizeMode(QHeaderView::Fixed);
|
||||||
|
#endif
|
||||||
// set the model
|
// set the model
|
||||||
table->setModel(model);
|
table->setModel(model);
|
||||||
|
|
||||||
|
@ -284,9 +289,14 @@ void PrintLayout::printTable()
|
||||||
table.setSelectionMode(QAbstractItemView::NoSelection);
|
table.setSelectionMode(QAbstractItemView::NoSelection);
|
||||||
table.setFocusPolicy(Qt::NoFocus);
|
table.setFocusPolicy(Qt::NoFocus);
|
||||||
table.horizontalHeader()->setVisible(false);
|
table.horizontalHeader()->setVisible(false);
|
||||||
table.horizontalHeader()->setResizeMode(QHeaderView::Fixed);
|
|
||||||
table.verticalHeader()->setVisible(false);
|
table.verticalHeader()->setVisible(false);
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
|
||||||
|
table.horizontalHeader()->setResizeMode(QHeaderView::Fixed);
|
||||||
table.verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
table.verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
|
||||||
|
#else
|
||||||
|
table.horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
||||||
|
table.verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||||
|
#endif
|
||||||
table.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
table.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
table.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
table.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
// fit table to one page initially
|
// fit table to one page initially
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue