diff --git a/examples/automotive/SoundControl.cpp b/examples/automotive/SoundControl.cpp index c79ffef1..4033419f 100644 --- a/examples/automotive/SoundControl.cpp +++ b/examples/automotive/SoundControl.cpp @@ -370,7 +370,7 @@ public: setAlignment( button, Qt::AlignCenter ); connect( button, &QskPushButton::pressed, - this, [ = ]() { shift( button->offset() ); } ); + this, [ this, button ]() { shift( button->offset() ); } ); } } diff --git a/examples/layouts/FlowLayoutPage.cpp b/examples/layouts/FlowLayoutPage.cpp index 15f20c5f..0353f8fe 100644 --- a/examples/layouts/FlowLayoutPage.cpp +++ b/examples/layouts/FlowLayoutPage.cpp @@ -91,11 +91,11 @@ FlowLayoutPage::FlowLayoutPage( QQuickItem* parent ): Box* box = new Box(); ButtonBox* buttonBox = new ButtonBox(); - buttonBox->addButton( "Flip", [ = ]() { box->transpose(); } ); - buttonBox->addButton( "Mirror", [ = ]() { box->mirror(); } ); - buttonBox->addButton( "Rotate", [ = ]() { box->rotate(); } ); - buttonBox->addButton( "Dim+", [ = ]() { box->incrementDimension( +1 ); } ); - buttonBox->addButton( "Dim-", [ = ]() { box->incrementDimension( -1 ); } ); + buttonBox->addButton( "Flip", [ box ]() { box->transpose(); } ); + buttonBox->addButton( "Mirror", [ box ]() { box->mirror(); } ); + buttonBox->addButton( "Rotate", [ box ]() { box->rotate(); } ); + buttonBox->addButton( "Dim+", [ box ]() { box->incrementDimension( +1 ); } ); + buttonBox->addButton( "Dim-", [ box ]() { box->incrementDimension( -1 ); } ); addItem( buttonBox, Qt::AlignTop | Qt::AlignLeft ); addItem( box ); diff --git a/examples/layouts/LinearLayoutPage.cpp b/examples/layouts/LinearLayoutPage.cpp index 6bae6e26..02156912 100644 --- a/examples/layouts/LinearLayoutPage.cpp +++ b/examples/layouts/LinearLayoutPage.cpp @@ -90,11 +90,11 @@ LinearLayoutPage::LinearLayoutPage( QQuickItem* parent ): Box* box = new Box(); ButtonBox* buttonBox = new ButtonBox(); - buttonBox->addButton( "Flip", [ = ]() { box->transpose(); } ); - buttonBox->addButton( "Mirror", [ = ]() { box->mirror(); } ); - buttonBox->addButton( "Rotate", [ = ]() { box->rotate(); } ); - buttonBox->addButton( "Spacing+", [ = ]() { box->incrementSpacing( +1 ); }, true ); - buttonBox->addButton( "Spacing-", [ = ]() { box->incrementSpacing( -1 ); }, true ); + buttonBox->addButton( "Flip", [ box ]() { box->transpose(); } ); + buttonBox->addButton( "Mirror", [ box ]() { box->mirror(); } ); + buttonBox->addButton( "Rotate", [ box ]() { box->rotate(); } ); + buttonBox->addButton( "Spacing+", [ box ]() { box->incrementSpacing( +1 ); }, true ); + buttonBox->addButton( "Spacing-", [ box ]() { box->incrementSpacing( -1 ); }, true ); addItem( buttonBox, Qt::AlignTop | Qt::AlignLeft ); addItem( box ); diff --git a/examples/layouts/StackLayoutPage.cpp b/examples/layouts/StackLayoutPage.cpp index 1ad2248c..8f130aad 100644 --- a/examples/layouts/StackLayoutPage.cpp +++ b/examples/layouts/StackLayoutPage.cpp @@ -107,11 +107,11 @@ StackLayoutPage::StackLayoutPage( QQuickItem* parent ): auto* box = new Box(); auto* buttonBox = new ButtonBox(); - buttonBox->addButton( "<<", [ = ]() { box->incrementScrolling( Qt::Horizontal, +1 ); } ); - buttonBox->addButton( ">>", [ = ]() { box->incrementScrolling( Qt::Horizontal, -1 ); } ); - buttonBox->addButton( "^", [ = ]() { box->incrementScrolling( Qt::Vertical, -1 ); } ); - buttonBox->addButton( "v", [ = ]() { box->incrementScrolling( Qt::Vertical, +1 ); } ); - buttonBox->addButton( "Fading", [ = ]() { box->incrementFading( +1 ); } ); + buttonBox->addButton( "<<", [ box ]() { box->incrementScrolling( Qt::Horizontal, +1 ); } ); + buttonBox->addButton( ">>", [ box ]() { box->incrementScrolling( Qt::Horizontal, -1 ); } ); + buttonBox->addButton( "^", [ box ]() { box->incrementScrolling( Qt::Vertical, -1 ); } ); + buttonBox->addButton( "v", [ box ]() { box->incrementScrolling( Qt::Vertical, +1 ); } ); + buttonBox->addButton( "Fading", [ box ]() { box->incrementFading( +1 ); } ); auto pageIndicator = new QskPageIndicator(); pageIndicator->setCount( box->itemCount() ); diff --git a/examples/sliders/main.cpp b/examples/sliders/main.cpp index 0c0fb9b3..d4a902fb 100644 --- a/examples/sliders/main.cpp +++ b/examples/sliders/main.cpp @@ -143,7 +143,7 @@ public: 0.5 * ( slider->maximum() - slider->minimum() ) ); #if 0 connect( slider, &QskSlider::valueChanged, - [ = ]( qreal value ) { qDebug() << value; } ); + []( qreal value ) { qDebug() << value; } ); #endif setAlignment( slider, Qt::AlignCenter ); } diff --git a/playground/inputpanel/main.cpp b/playground/inputpanel/main.cpp index 75173155..defd4ce4 100644 --- a/playground/inputpanel/main.cpp +++ b/playground/inputpanel/main.cpp @@ -98,10 +98,10 @@ public: // 2) QskInputPanel does not work properly in the threaded environment #if 1 connect( this, &QskListView::selectedRowChanged, - this, [ = ] { qskSetup->inputPanel()->setLocale( m_values[selectedRow()].second ); } ); + this, [ this ] { qskSetup->inputPanel()->setLocale( m_values[selectedRow()].second ); } ); #else connect( this, &QskListView::selectedRowChanged, - this, [ = ] { QLocale::setDefault( m_values[selectedRow()].second ); } ); + this, [ this ] { QLocale::setDefault( m_values[selectedRow()].second ); } ); #endif } diff --git a/src/controls/QskAnimator.cpp b/src/controls/QskAnimator.cpp index 6df6c39d..f38e7a43 100644 --- a/src/controls/QskAnimator.cpp +++ b/src/controls/QskAnimator.cpp @@ -140,13 +140,13 @@ void QskAnimatorDriver::registerAnimator( QskAnimator* animator ) m_windows += window; connect( window, &QQuickWindow::afterAnimating, - this, [ = ]() { advanceAnimators( window ); } ); + this, [ this, window ]() { advanceAnimators( window ); } ); connect( window, &QQuickWindow::frameSwapped, - this, [ = ]() { scheduleUpdate( window ); } ); + this, [ this, window ]() { scheduleUpdate( window ); } ); connect( window, &QObject::destroyed, - this, [ = ]( QObject* ) { removeWindow( window ); } ); + this, [ this, window ]( QObject* ) { removeWindow( window ); } ); window->update(); } diff --git a/src/controls/QskDirtyItemFilter.cpp b/src/controls/QskDirtyItemFilter.cpp index fdd99fd5..9f670764 100644 --- a/src/controls/QskDirtyItemFilter.cpp +++ b/src/controls/QskDirtyItemFilter.cpp @@ -61,7 +61,7 @@ void QskDirtyItemFilter::addWindow( QQuickWindow* window ) */ connect( window, &QQuickWindow::beforeSynchronizing, - window, [ = ] { beforeSynchronizing( window ); }, + window, [ this, window ] { beforeSynchronizing( window ); }, Qt::DirectConnection ); connect( window, &QObject::destroyed, this, &QskDirtyItemFilter::cleanUp ); diff --git a/src/controls/QskSubWindowArea.cpp b/src/controls/QskSubWindowArea.cpp index 31162e38..482a7ece 100644 --- a/src/controls/QskSubWindowArea.cpp +++ b/src/controls/QskSubWindowArea.cpp @@ -125,9 +125,9 @@ void QskSubWindowArea::itemChange( QQuickItem::ItemChange change, case QQuickItem::ItemChildAddedChange: { // the child is not fully constructed - // and we have delay checking for sub windows + // and we have to delay checking for sub windows QTimer::singleShot( 0, this, - [ = ] { qskUpdateEventFilter( this ); } ); + [ this ] { qskUpdateEventFilter( this ); } ); break; } diff --git a/src/controls/QskTabBar.cpp b/src/controls/QskTabBar.cpp index 78af3147..d0f07d3b 100644 --- a/src/controls/QskTabBar.cpp +++ b/src/controls/QskTabBar.cpp @@ -133,11 +133,11 @@ int QskTabBar::insertTab( int index, QskTabButton* button ) button->setTextOptions( m_data->textOptions ); auto onTabSelected = - [ = ] ( bool on ) + [ this, button ] ( bool on ) { if ( on ) { - int pos = indexOf( button ); + const int pos = indexOf( button ); if ( pos >= 0 && pos != m_data->currentIndex ) { m_data->currentIndex = pos;