Qt: Work around gcc 4.8 bug

This commit is contained in:
Jeffrey Pfau 2016-10-21 11:56:11 -07:00
parent d6c055f9d8
commit 8aee104862
2 changed files with 14 additions and 5 deletions

View File

@ -453,10 +453,18 @@ void Window::openAboutScreen() {
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);
};
}

View File

@ -133,7 +133,8 @@ private:
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);