@@ -75,9 +75,9 @@ QgsAttributeForm::QgsAttributeForm( QgsVectorLayer* vl, const QgsFeature &featur
75
75
initPython ();
76
76
setFeature ( feature );
77
77
78
- connect ( vl, SIGNAL ( updatedFields () ) , this , SLOT ( onUpdatedFields () ) );
79
- connect ( vl, SIGNAL ( beforeAddingExpressionField ( QString ) ) , this , SLOT ( preventFeatureRefresh () ) );
80
- connect ( vl, SIGNAL ( beforeRemovingExpressionField ( int ) ) , this , SLOT ( preventFeatureRefresh () ) );
78
+ connect ( vl, &QgsVectorLayer:: updatedFields, this , &QgsAttributeForm:: onUpdatedFields );
79
+ connect ( vl, &QgsVectorLayer:: beforeAddingExpressionField, this , &QgsAttributeForm:: preventFeatureRefresh );
80
+ connect ( vl, &QgsVectorLayer:: beforeRemovingExpressionField, this , &QgsAttributeForm:: preventFeatureRefresh );
81
81
connect ( vl, SIGNAL ( selectionChanged () ), this , SLOT ( layerSelectionChanged () ) );
82
82
83
83
// constraints management
@@ -96,20 +96,20 @@ void QgsAttributeForm::hideButtonBox()
96
96
97
97
// Make sure that changes are taken into account if somebody tries to figure out if there have been some
98
98
if ( mMode == SingleEditMode )
99
- connect ( mLayer , SIGNAL ( beforeModifiedCheck () ) , this , SLOT ( save () ) );
99
+ connect ( mLayer , &QgsVectorLayer:: beforeModifiedCheck, this , &QgsAttributeForm:: save );
100
100
}
101
101
102
102
void QgsAttributeForm::showButtonBox ()
103
103
{
104
104
mButtonBox ->show ();
105
105
106
- disconnect ( mLayer , SIGNAL ( beforeModifiedCheck () ) , this , SLOT ( save () ) );
106
+ disconnect ( mLayer , &QgsVectorLayer:: beforeModifiedCheck, this , &QgsAttributeForm:: save );
107
107
}
108
108
109
109
void QgsAttributeForm::disconnectButtonBox ()
110
110
{
111
- disconnect ( mButtonBox , SIGNAL ( accepted () ) , this , SLOT ( accept () ) );
112
- disconnect ( mButtonBox , SIGNAL ( rejected () ) , this , SLOT ( resetValues () ) );
111
+ disconnect ( mButtonBox , &QDialogButtonBox:: accepted, this , &QgsAttributeForm::save );
112
+ disconnect ( mButtonBox , &QDialogButtonBox:: rejected, this , &QgsAttributeForm:: resetValues );
113
113
}
114
114
115
115
void QgsAttributeForm::addInterface ( QgsAttributeFormInterface* iface )
@@ -148,11 +148,11 @@ void QgsAttributeForm::setMode( QgsAttributeForm::Mode mode )
148
148
149
149
if ( mButtonBox ->isVisible () && mMode == SingleEditMode )
150
150
{
151
- connect ( mLayer , SIGNAL ( beforeModifiedCheck () ) , this , SLOT ( save () ) );
151
+ connect ( mLayer , &QgsVectorLayer:: beforeModifiedCheck, this , &QgsAttributeForm:: save );
152
152
}
153
153
else
154
154
{
155
- disconnect ( mLayer , SIGNAL ( beforeModifiedCheck () ) , this , SLOT ( save () ) );
155
+ disconnect ( mLayer , &QgsVectorLayer:: beforeModifiedCheck, this , &QgsAttributeForm:: save );
156
156
}
157
157
158
158
// update all form editor widget modes to match
@@ -660,7 +660,7 @@ void QgsAttributeForm::onAttributeChanged( const QVariant& value )
660
660
QLabel *msgLabel = new QLabel ( tr ( " Unsaved multiedit changes: <a href=\" #apply\" >apply changes</a> or <a href=\" #reset\" >reset changes</a>." ), mMessageBar );
661
661
msgLabel->setAlignment ( Qt::AlignLeft | Qt::AlignVCenter );
662
662
msgLabel->setSizePolicy ( QSizePolicy::MinimumExpanding, QSizePolicy::Fixed );
663
- connect ( msgLabel, SIGNAL ( linkActivated ( QString ) ) , this , SLOT ( multiEditMessageClicked ( QString ) ) );
663
+ connect ( msgLabel, &QLabel:: linkActivated, this , &QgsAttributeForm:: multiEditMessageClicked );
664
664
clearMultiEditMessages ();
665
665
666
666
mMultiEditUnsavedMessageBarItem = new QgsMessageBarItem ( msgLabel, QgsMessageBar::WARNING );
@@ -1314,27 +1314,27 @@ void QgsAttributeForm::init()
1314
1314
mSearchButtonBox ->setObjectName ( QStringLiteral ( " searchButtonBox" ) );
1315
1315
1316
1316
QPushButton* clearButton = new QPushButton ( tr ( " &Reset form" ), mSearchButtonBox );
1317
- connect ( clearButton, SIGNAL ( clicked ( bool ) ) , this , SLOT ( resetSearch () ) );
1317
+ connect ( clearButton, &QPushButton:: clicked, this , &QgsAttributeForm:: resetSearch );
1318
1318
boxLayout->addWidget ( clearButton );
1319
1319
boxLayout->addStretch ( 1 );
1320
1320
1321
1321
QToolButton* selectButton = new QToolButton ();
1322
1322
selectButton->setSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Minimum );
1323
1323
selectButton->setText ( tr ( " &Select features" ) );
1324
1324
selectButton->setPopupMode ( QToolButton::MenuButtonPopup );
1325
- connect ( selectButton, SIGNAL ( clicked ( bool ) ) , this , SLOT ( searchSetSelection () ) );
1325
+ connect ( selectButton, &QToolButton:: clicked, this , &QgsAttributeForm:: searchSetSelection );
1326
1326
QMenu* selectMenu = new QMenu ( selectButton );
1327
1327
QAction* selectAction = new QAction ( tr ( " Select features" ), selectMenu );
1328
- connect ( selectAction, SIGNAL ( triggered ( bool ) ) , this , SLOT ( searchSetSelection () ) );
1328
+ connect ( selectAction, &QAction:: triggered, this , &QgsAttributeForm:: searchSetSelection );
1329
1329
selectMenu->addAction ( selectAction );
1330
1330
QAction* addSelectAction = new QAction ( tr ( " Add to current selection" ), selectMenu );
1331
- connect ( addSelectAction, SIGNAL ( triggered ( bool ) ) , this , SLOT ( searchAddToSelection () ) );
1331
+ connect ( addSelectAction, &QAction:: triggered, this , &QgsAttributeForm:: searchAddToSelection );
1332
1332
selectMenu->addAction ( addSelectAction );
1333
1333
QAction* filterSelectAction = new QAction ( tr ( " Filter current selection" ), selectMenu );
1334
- connect ( filterSelectAction, SIGNAL ( triggered ( bool ) ) , this , SLOT ( searchIntersectSelection () ) );
1334
+ connect ( filterSelectAction, &QAction:: triggered, this , &QgsAttributeForm:: searchIntersectSelection );
1335
1335
selectMenu->addAction ( filterSelectAction );
1336
1336
QAction* deselectAction = new QAction ( tr ( " Remove from current selection" ), selectMenu );
1337
- connect ( deselectAction, SIGNAL ( triggered ( bool ) ) , this , SLOT ( searchRemoveFromSelection () ) );
1337
+ connect ( deselectAction, &QAction:: triggered, this , &QgsAttributeForm:: searchRemoveFromSelection );
1338
1338
selectMenu->addAction ( deselectAction );
1339
1339
selectButton->setMenu ( selectMenu );
1340
1340
boxLayout->addWidget ( selectButton );
@@ -1345,21 +1345,21 @@ void QgsAttributeForm::init()
1345
1345
filterButton->setText ( tr ( " Filter features" ) );
1346
1346
filterButton->setPopupMode ( QToolButton::MenuButtonPopup );
1347
1347
filterButton->setSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Minimum );
1348
- connect ( filterButton, SIGNAL ( clicked ( bool ) ) , this , SLOT ( filterTriggered () ) );
1348
+ connect ( filterButton, &QToolButton:: clicked, this , &QgsAttributeForm:: filterTriggered );
1349
1349
QMenu* filterMenu = new QMenu ( filterButton );
1350
1350
QAction* filterAndAction = new QAction ( tr ( " Filter within (\" AND\" )" ), filterMenu );
1351
- connect ( filterAndAction, SIGNAL ( triggered ( bool ) ) , this , SLOT ( filterAndTriggered () ) );
1351
+ connect ( filterAndAction, &QAction:: triggered, this , &QgsAttributeForm:: filterAndTriggered );
1352
1352
filterMenu->addAction ( filterAndAction );
1353
1353
QAction* filterOrAction = new QAction ( tr ( " Extend filter (\" OR\" )" ), filterMenu );
1354
- connect ( filterOrAction, SIGNAL ( triggered ( bool ) ) , this , SLOT ( filterOrTriggered () ) );
1354
+ connect ( filterOrAction, &QAction:: triggered, this , &QgsAttributeForm:: filterOrTriggered );
1355
1355
filterMenu->addAction ( filterOrAction );
1356
1356
filterButton->setMenu ( filterMenu );
1357
1357
boxLayout->addWidget ( filterButton );
1358
1358
}
1359
1359
else
1360
1360
{
1361
1361
QPushButton* closeButton = new QPushButton ( tr ( " Close" ), mSearchButtonBox );
1362
- connect ( closeButton, SIGNAL ( clicked ( bool ) ) , this , SIGNAL ( closed () ) );
1362
+ connect ( closeButton, &QPushButton:: clicked, this , &QgsAttributeForm:: closed );
1363
1363
closeButton->setShortcut ( Qt::Key_Escape );
1364
1364
boxLayout->addWidget ( closeButton );
1365
1365
}
@@ -1370,11 +1370,11 @@ void QgsAttributeForm::init()
1370
1370
1371
1371
afterWidgetInit ();
1372
1372
1373
- connect ( mButtonBox , SIGNAL ( accepted () ) , this , SLOT ( accept () ) );
1374
- connect ( mButtonBox , SIGNAL ( rejected () ) , this , SLOT ( resetValues () ) );
1373
+ connect ( mButtonBox , &QDialogButtonBox:: accepted, this , &QgsAttributeForm::save );
1374
+ connect ( mButtonBox , &QDialogButtonBox:: rejected, this , &QgsAttributeForm:: resetValues );
1375
1375
1376
- connect ( mLayer , SIGNAL ( editingStarted () ) , this , SLOT ( synchronizeEnabledState () ) );
1377
- connect ( mLayer , SIGNAL ( editingStopped () ) , this , SLOT ( synchronizeEnabledState () ) );
1376
+ connect ( mLayer , &QgsVectorLayer:: editingStarted, this , &QgsAttributeForm:: synchronizeEnabledState );
1377
+ connect ( mLayer , &QgsVectorLayer:: editingStopped, this , &QgsAttributeForm:: synchronizeEnabledState );
1378
1378
1379
1379
Q_FOREACH ( QgsAttributeFormInterface* iface, mInterfaces )
1380
1380
{
@@ -1750,8 +1750,7 @@ void QgsAttributeForm::afterWidgetInit()
1750
1750
}
1751
1751
1752
1752
connect ( eww, SIGNAL ( valueChanged ( const QVariant& ) ), this , SLOT ( onAttributeChanged ( const QVariant& ) ) );
1753
- connect ( eww, SIGNAL ( constraintStatusChanged ( QString, QString, QString, bool ) ),
1754
- this , SLOT ( onConstraintStatusChanged ( QString, QString, QString, bool ) ) );
1753
+ connect ( eww, &QgsEditorWidgetWrapper::constraintStatusChanged, this , &QgsAttributeForm::onConstraintStatusChanged );
1755
1754
}
1756
1755
}
1757
1756
0 commit comments