QT5 -- Enable build on 4.8.4 -OR- 5.2.0

New strategy to enable build on QT5 or QT4.8 is quite
simple to enact as most of the fixes for QT5 can be
applied to earlier releases.

This patch fixes up some of the special cases for QT5 so
they will continue to build on earlier releases.
This commit is contained in:
Mark Liversedge
2013-12-10 16:07:41 +00:00
parent 64c25192ee
commit e6ccd840f2
11 changed files with 108 additions and 24 deletions

View File

@@ -65,8 +65,13 @@ DiaryWindow::DiaryWindow(Context *context) :
monthlyView = new QTableView(this);
monthlyView->setItemDelegate(new GcCalendarDelegate);
monthlyView->setModel(calendarModel);
#if QT_VERSION > 0x050000
monthlyView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
monthlyView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
#else
monthlyView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
monthlyView->verticalHeader()->setResizeMode(QHeaderView::Stretch);
#endif
monthlyView->verticalHeader()->hide();
monthlyView->viewport()->installEventFilter(this);
monthlyView->setGridStyle(Qt::DotLine);