From 8aee10486211a8b549dcc2a9d42a4174b2ded1a0 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Fri, 21 Oct 2016 11:56:11 -0700 Subject: [PATCH] Qt: Work around gcc 4.8 bug --- src/platform/qt/Window.cpp | 16 ++++++++++++---- src/platform/qt/Window.h | 3 ++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 3944e55ff..3a9a7982a 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -453,10 +453,18 @@ void Window::openAboutScreen() { openView(about); } -template -std::function Window::openTView(const Args&... args) { - return [this, args...]() { - T* view = new T(m_controller, args...); +template +std::function Window::openTView(A arg) { + return [=]() { + T* view = new T(m_controller, arg); + openView(view); + }; +} + +template +std::function Window::openTView() { + return [=]() { + T* view = new T(m_controller); openView(view); }; } diff --git a/src/platform/qt/Window.h b/src/platform/qt/Window.h index 6a3ad94ae..6189fedd7 100644 --- a/src/platform/qt/Window.h +++ b/src/platform/qt/Window.h @@ -133,7 +133,8 @@ private: void openView(QWidget* widget); - template std::function openTView(const Args&...); + template std::function openTView(A arg); + template std::function openTView(); QAction* addControlledAction(QMenu* menu, QAction* action, const QString& name); QAction* addHiddenAction(QMenu* menu, QAction* action, const QString& name);