From e7b8df6349c059c7ae16ca954e62d503d36c70fb Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Mon, 9 Jan 2017 15:40:32 +0300 Subject: examples: Use lambdas instead of functor classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iee2cc22a9239ab5a351cb5ecb2c8ce10ed019b2c Reviewed-by: Friedemann Kleint Reviewed-by: Topi Reiniƶ --- examples/widgets/mainwindows/mainwindow/mainwindow.cpp | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'examples/widgets/mainwindows/mainwindow') 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; -- cgit v1.2.3