diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-01-15 09:30:37 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-01-15 15:49:47 +0700 |
commit | 5ff961b03339a5a8c77eb815bb8187a5cd8b9a04 (patch) | |
tree | 1cecfc1ffca0af8e63aa155fe45050b8cde07a30 /qt-ui/printlayout.cpp | |
parent | abfd86af5982318be7d791f53a668b92a75e8f88 (diff) | |
download | subsurface-5ff961b03339a5a8c77eb815bb8187a5cd8b9a04.tar.gz |
Use setSectionResizeMode if we use Qt5
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/printlayout.cpp')
-rw-r--r-- | qt-ui/printlayout.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp index e60a3189f..b058bbc7d 100644 --- a/qt-ui/printlayout.cpp +++ b/qt-ui/printlayout.cpp @@ -219,9 +219,14 @@ QTableView *PrintLayout::createProfileTable(ProfilePrintModel *model, const int table->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); table->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); hHeader->setVisible(false); - hHeader->setResizeMode(QHeaderView::Fixed); vHeader->setVisible(false); +#if QT_VERSION < QT_VERSION_CHECK(5,0,0) + hHeader->setResizeMode(QHeaderView::Fixed); vHeader->setResizeMode(QHeaderView::Fixed); +#else + hHeader->setSectionResizeMode(QHeaderView::Fixed); + vHeader->setSectionResizeMode(QHeaderView::Fixed); +#endif // set the model table->setModel(model); @@ -284,9 +289,14 @@ void PrintLayout::printTable() table.setSelectionMode(QAbstractItemView::NoSelection); table.setFocusPolicy(Qt::NoFocus); table.horizontalHeader()->setVisible(false); - table.horizontalHeader()->setResizeMode(QHeaderView::Fixed); table.verticalHeader()->setVisible(false); +#if QT_VERSION < QT_VERSION_CHECK(5,0,0) + table.horizontalHeader()->setResizeMode(QHeaderView::Fixed); table.verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); +#else + table.horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed); + table.verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); +#endif table.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); table.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // fit table to one page initially |