@@ -96,7 +96,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
96
96
connect ( mCustomVariablesChkBx , &QCheckBox::toggled, this , &QgsOptions::mCustomVariablesChkBx_toggled );
97
97
connect ( mCurrentVariablesQGISChxBx , &QCheckBox::toggled, this , &QgsOptions::mCurrentVariablesQGISChxBx_toggled );
98
98
connect ( buttonBox, &QDialogButtonBox::helpRequested, this , &QgsOptions::showHelp );
99
- connect ( cboGlobalLocale, static_cast < void ( QComboBox::* )( int )> ( &QComboBox::currentIndexChanged ), [ = ]( int ) { updateSampleLocaleText ( ); } );
99
+ connect ( cboGlobalLocale, qgis::overload< int >:: of ( &QComboBox::currentIndexChanged ), [ = ]( int ) { updateSampleLocaleText ( ); } );
100
100
connect ( cbShowGroupSeparator, &QCheckBox::toggled, this , [ = ]( bool ) { updateSampleLocaleText (); } );
101
101
102
102
// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
@@ -674,30 +674,30 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
674
674
mRasterCumulativeCutUpperDoubleSpinBox ->setValue ( 100.0 * mSettings ->value ( QStringLiteral ( " /Raster/cumulativeCutUpper" ), QString::number ( QgsRasterMinMaxOrigin::CUMULATIVE_CUT_UPPER ) ).toDouble () );
675
675
676
676
// set the color for selections
677
- int myRed = mSettings ->value ( QStringLiteral ( " /qgis/default_selection_color_red" ), 255 ).toInt ();
678
- int myGreen = mSettings ->value ( QStringLiteral ( " /qgis/default_selection_color_green" ), 255 ).toInt ();
679
- int myBlue = mSettings ->value ( QStringLiteral ( " /qgis/default_selection_color_blue" ), 0 ).toInt ();
680
- int myAlpha = mSettings ->value ( QStringLiteral ( " /qgis/default_selection_color_alpha" ), 255 ).toInt ();
681
- pbnSelectionColor->setColor ( QColor ( myRed, myGreen, myBlue, myAlpha ) );
677
+ int red = mSettings ->value ( QStringLiteral ( " /qgis/default_selection_color_red" ), 255 ).toInt ();
678
+ int green = mSettings ->value ( QStringLiteral ( " /qgis/default_selection_color_green" ), 255 ).toInt ();
679
+ int blue = mSettings ->value ( QStringLiteral ( " /qgis/default_selection_color_blue" ), 0 ).toInt ();
680
+ int alpha = mSettings ->value ( QStringLiteral ( " /qgis/default_selection_color_alpha" ), 255 ).toInt ();
681
+ pbnSelectionColor->setColor ( QColor ( red, green, blue, alpha ) );
682
682
pbnSelectionColor->setColorDialogTitle ( tr ( " Set Selection Color" ) );
683
683
pbnSelectionColor->setAllowOpacity ( true );
684
684
pbnSelectionColor->setContext ( QStringLiteral ( " gui" ) );
685
685
pbnSelectionColor->setDefaultColor ( QColor ( 255 , 255 , 0 , 255 ) );
686
686
687
687
// set the default color for canvas background
688
- myRed = mSettings ->value ( QStringLiteral ( " /qgis/default_canvas_color_red" ), 255 ).toInt ();
689
- myGreen = mSettings ->value ( QStringLiteral ( " /qgis/default_canvas_color_green" ), 255 ).toInt ();
690
- myBlue = mSettings ->value ( QStringLiteral ( " /qgis/default_canvas_color_blue" ), 255 ).toInt ();
691
- pbnCanvasColor->setColor ( QColor ( myRed, myGreen, myBlue ) );
688
+ red = mSettings ->value ( QStringLiteral ( " /qgis/default_canvas_color_red" ), 255 ).toInt ();
689
+ green = mSettings ->value ( QStringLiteral ( " /qgis/default_canvas_color_green" ), 255 ).toInt ();
690
+ blue = mSettings ->value ( QStringLiteral ( " /qgis/default_canvas_color_blue" ), 255 ).toInt ();
691
+ pbnCanvasColor->setColor ( QColor ( red, green, blue ) );
692
692
pbnCanvasColor->setColorDialogTitle ( tr ( " Set Canvas Color" ) );
693
693
pbnCanvasColor->setContext ( QStringLiteral ( " gui" ) );
694
694
pbnCanvasColor->setDefaultColor ( Qt::white );
695
695
696
696
// set the default color for the measure tool
697
- myRed = mSettings ->value ( QStringLiteral ( " /qgis/default_measure_color_red" ), 222 ).toInt ();
698
- myGreen = mSettings ->value ( QStringLiteral ( " /qgis/default_measure_color_green" ), 155 ).toInt ();
699
- myBlue = mSettings ->value ( QStringLiteral ( " /qgis/default_measure_color_blue" ), 67 ).toInt ();
700
- pbnMeasureColor->setColor ( QColor ( myRed, myGreen, myBlue ) );
697
+ red = mSettings ->value ( QStringLiteral ( " /qgis/default_measure_color_red" ), 222 ).toInt ();
698
+ green = mSettings ->value ( QStringLiteral ( " /qgis/default_measure_color_green" ), 155 ).toInt ();
699
+ blue = mSettings ->value ( QStringLiteral ( " /qgis/default_measure_color_blue" ), 67 ).toInt ();
700
+ pbnMeasureColor->setColor ( QColor ( red, green, blue ) );
701
701
pbnMeasureColor->setColorDialogTitle ( tr ( " Set Measuring Tool Color" ) );
702
702
pbnMeasureColor->setContext ( QStringLiteral ( " gui" ) );
703
703
pbnMeasureColor->setDefaultColor ( QColor ( 222 , 155 , 67 ) );
@@ -905,13 +905,13 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
905
905
//
906
906
// Translation and locale settings
907
907
//
908
- QString mySystemLocale = QLocale ().name ();
909
- lblSystemLocale->setText ( tr ( " Detected active locale on your system: %1" ).arg ( mySystemLocale ) );
910
- QString myUserLocale = mSettings ->value ( QStringLiteral ( " locale/userLocale" ), QString () ).toString ();
908
+ QString systemLocale = QLocale ().name ();
909
+ lblSystemLocale->setText ( tr ( " Detected active locale on your system: %1" ).arg ( systemLocale ) );
910
+ QString userLocale = mSettings ->value ( QStringLiteral ( " locale/userLocale" ), QString () ).toString ();
911
911
bool showGroupSeparator = mSettings ->value ( QStringLiteral ( " locale/showGroupSeparator" ), false ).toBool ();
912
- QString myGlobalLocale = mSettings ->value ( QStringLiteral ( " locale/globalLocale" ), QString () ).toString ();
913
- QStringList myI18nList = i18nList ();
914
- Q_FOREACH ( const QString &l, myI18nList )
912
+ QString globalLocale = mSettings ->value ( QStringLiteral ( " locale/globalLocale" ), QLocale (). name () ).toString ();
913
+ const QStringList curentI18nList ( i18nList () );
914
+ for ( const auto &l : curentI18nList )
915
915
{
916
916
// QTBUG-57802: eo locale is improperly handled
917
917
QString displayName = l.startsWith ( QLatin1String ( " eo" ) ) ? QLocale::languageToString ( QLocale::Esperanto ) : QLocale ( l ).nativeLanguageName ();
@@ -934,29 +934,29 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
934
934
}
935
935
}
936
936
937
- cboTranslation->setCurrentIndex ( cboTranslation->findData ( myUserLocale ) );
938
- cboGlobalLocale->setCurrentIndex ( cboGlobalLocale->findData ( myGlobalLocale ) );
939
- bool myLocaleOverrideFlag = mSettings ->value ( QStringLiteral ( " locale/overrideFlag" ), false ).toBool ();
940
- grpLocale->setChecked ( myLocaleOverrideFlag );
937
+ cboTranslation->setCurrentIndex ( cboTranslation->findData ( userLocale ) );
938
+ cboGlobalLocale->setCurrentIndex ( cboGlobalLocale->findData ( globalLocale ) );
939
+ bool localeOverrideFlag = mSettings ->value ( QStringLiteral ( " locale/overrideFlag" ), false ).toBool ();
940
+ grpLocale->setChecked ( localeOverrideFlag );
941
941
cbShowGroupSeparator->setChecked ( showGroupSeparator );
942
942
943
943
944
944
// set elements in digitizing tab
945
945
mLineWidthSpinBox ->setValue ( mSettings ->value ( QStringLiteral ( " /qgis/digitizing/line_width" ), 1 ).toInt () );
946
- myRed = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/line_color_red" ), 255 ).toInt ();
947
- myGreen = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/line_color_green" ), 0 ).toInt ();
948
- myBlue = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/line_color_blue" ), 0 ).toInt ();
949
- myAlpha = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/line_color_alpha" ), 200 ).toInt ();
950
- mLineColorToolButton ->setColor ( QColor ( myRed, myGreen, myBlue, myAlpha ) );
946
+ red = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/line_color_red" ), 255 ).toInt ();
947
+ green = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/line_color_green" ), 0 ).toInt ();
948
+ blue = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/line_color_blue" ), 0 ).toInt ();
949
+ alpha = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/line_color_alpha" ), 200 ).toInt ();
950
+ mLineColorToolButton ->setColor ( QColor ( red, green, blue, alpha ) );
951
951
mLineColorToolButton ->setAllowOpacity ( true );
952
952
mLineColorToolButton ->setContext ( QStringLiteral ( " gui" ) );
953
953
mLineColorToolButton ->setDefaultColor ( QColor ( 255 , 0 , 0 , 200 ) );
954
954
955
- myRed = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/fill_color_red" ), 255 ).toInt ();
956
- myGreen = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/fill_color_green" ), 0 ).toInt ();
957
- myBlue = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/fill_color_blue" ), 0 ).toInt ();
958
- myAlpha = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/fill_color_alpha" ), 30 ).toInt ();
959
- mFillColorToolButton ->setColor ( QColor ( myRed, myGreen, myBlue, myAlpha ) );
955
+ red = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/fill_color_red" ), 255 ).toInt ();
956
+ green = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/fill_color_green" ), 0 ).toInt ();
957
+ blue = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/fill_color_blue" ), 0 ).toInt ();
958
+ alpha = mSettings ->value ( QStringLiteral ( " /qgis/digitizing/fill_color_alpha" ), 30 ).toInt ();
959
+ mFillColorToolButton ->setColor ( QColor ( red, green, blue, alpha ) );
960
960
mFillColorToolButton ->setAllowOpacity ( true );
961
961
mFillColorToolButton ->setContext ( QStringLiteral ( " gui" ) );
962
962
mFillColorToolButton ->setDefaultColor ( QColor ( 255 , 0 , 0 , 30 ) );
@@ -2388,7 +2388,7 @@ void QgsOptions::updateSampleLocaleText()
2388
2388
QLocale locale ( cboGlobalLocale->currentData ( ).toString () );
2389
2389
if ( cbShowGroupSeparator->isChecked ( ) )
2390
2390
{
2391
- locale.setNumberOptions ( locale.numberOptions () &= ! QLocale::NumberOption::OmitGroupSeparator );
2391
+ locale.setNumberOptions ( locale.numberOptions () &= ~ QLocale::NumberOption::OmitGroupSeparator );
2392
2392
}
2393
2393
else
2394
2394
{
0 commit comments