Qt: Work around gcc 4.8 bug
Jeffrey Pfau jeffrey@endrift.com
Fri, 21 Oct 2016 11:56:11 -0700
2 files changed,
14 insertions(+),
5 deletions(-)
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -453,10 +453,18 @@ AboutScreen* about = new AboutScreen();
openView(about); } -template <typename T, typename... Args> -std::function<void()> Window::openTView(const Args&... args) { - return [this, args...]() { - T* view = new T(m_controller, args...); +template <typename T, typename A> +std::function<void()> Window::openTView(A arg) { + return [=]() { + T* view = new T(m_controller, arg); + openView(view); + }; +} + +template <typename T> +std::function<void()> Window::openTView() { + return [=]() { + T* view = new T(m_controller); openView(view); }; }
M
src/platform/qt/Window.h
→
src/platform/qt/Window.h
@@ -133,7 +133,8 @@ void updateMRU();
void openView(QWidget* widget); - template <typename T, typename... Args> std::function<void()> openTView(const Args&...); + template <typename T, typename A> std::function<void()> openTView(A arg); + template <typename T> std::function<void()> openTView(); QAction* addControlledAction(QMenu* menu, QAction* action, const QString& name); QAction* addHiddenAction(QMenu* menu, QAction* action, const QString& name);