From 3247028deec3ad4beb6d90e19f53f1b1e0e3b13e Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 17 Jun 2014 07:43:35 +0200 Subject: [PATCH] Core: Utils: Fix compile with Qt4 Change-Id: Ibe4b504b84e467b1450b63bbbc7b569558fd8733 Reviewed-by: hjk --- src/libs/utils/algorithm.h | 12 +++++++++++- .../coreplugin/editormanager/openeditorswindow.cpp | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/libs/utils/algorithm.h b/src/libs/utils/algorithm.h index a7ed90e15d6..f75dae1f443 100644 --- a/src/libs/utils/algorithm.h +++ b/src/libs/utils/algorithm.h @@ -32,7 +32,17 @@ #include -#include // for Q_REQUIRE_RESULT +#if QT_VERSION < 0x050000 + #ifndef Q_REQUIRED_RESULT + # if defined(Q_CC_GNU) + # define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result)) + # else + # define Q_REQUIRED_RESULT + # endif + #endif +#else + #include // for Q_REQUIRED_RESULT +#endif namespace Utils { diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp index c58f3cba659..24ae5fb27c2 100644 --- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp +++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp @@ -158,7 +158,11 @@ void OpenEditorsWindow::selectPreviousEditor() QSize OpenEditorsTreeWidget::sizeHint() const { return QSize(sizeHintForColumn(0) + verticalScrollBar()->width() + frameWidth() * 2, +#if QT_VERSION < 0x050200 + minimumHeight()); +#else viewportSizeHint().height() + frameWidth() * 2); +#endif } QSize OpenEditorsWindow::sizeHint() const