summaryrefslogtreecommitdiffstats
path: root/examples/widgets/mainwindows/mainwindow
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2017-01-09 15:40:32 +0300
committerAlexander Volkov <a.volkov@rusbitech.ru>2017-01-09 15:42:13 +0000
commite7b8df6349c059c7ae16ca954e62d503d36c70fb (patch)
tree9a50b4da165d652449f4a56cf25a128a52b05ad1 /examples/widgets/mainwindows/mainwindow
parent280f067fe0c5a11a38e60d42d6cc74152515793a (diff)
examples: Use lambdas instead of functor classes
Change-Id: Iee2cc22a9239ab5a351cb5ecb2c8ce10ed019b2c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'examples/widgets/mainwindows/mainwindow')
-rw-r--r--examples/widgets/mainwindows/mainwindow/mainwindow.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
index a21a64bdd4..10e3dd045a 100644
--- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
+++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp
@@ -282,23 +282,10 @@ void MainWindow::loadLayout()
}
}
-class DockWidgetAreaCornerFunctor {
-public:
- explicit DockWidgetAreaCornerFunctor(QMainWindow *mw, Qt::Corner c, Qt::DockWidgetArea a)
- : m_mainWindow(mw), m_area(a), m_corner(c) {}
-
- void operator()() const { m_mainWindow->setCorner(m_corner, m_area); }
-
-private:
- QMainWindow *m_mainWindow;
- Qt::DockWidgetArea m_area;
- Qt::Corner m_corner;
-};
-
static QAction *addCornerAction(const QString &text, QMainWindow *mw, QMenu *menu, QActionGroup *group,
Qt::Corner c, Qt::DockWidgetArea a)
{
- QAction *result = menu->addAction(text, mw, DockWidgetAreaCornerFunctor(mw, c, a));
+ QAction *result = menu->addAction(text, mw, [=]() { mw->setCorner(c, a); });
result->setCheckable(true);
group->addAction(result);
return result;