all repos — mgba @ 8aee10486211a8b549dcc2a9d42a4174b2ded1a0

mGBA Game Boy Advance Emulator

Qt: Work around gcc 4.8 bug
Jeffrey Pfau jeffrey@endrift.com
Fri, 21 Oct 2016 11:56:11 -0700
commit

8aee10486211a8b549dcc2a9d42a4174b2ded1a0

parent

d6c055f9d878486b706194a320040d98a1e262c4

2 files changed, 14 insertions(+), 5 deletions(-)

jump to
M src/platform/qt/Window.cppsrc/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.hsrc/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);