@@ -96,6 +96,8 @@ 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 ( ); } );
100
+ connect ( cbOmitGroupSeparator, &QCheckBox::toggled, this , [ = ]( bool ) { updateSampleLocaleText (); } );
99
101
100
102
// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
101
103
// switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
@@ -2365,6 +2367,24 @@ void QgsOptions::refreshSchemeComboBox()
2365
2367
mColorSchemesComboBox ->blockSignals ( false );
2366
2368
}
2367
2369
2370
+ void QgsOptions::updateSampleLocaleText ()
2371
+ {
2372
+ QLocale locale ( cboGlobalLocale->currentData ( ).toString () );
2373
+ if ( cbOmitGroupSeparator->isChecked ( ) )
2374
+ {
2375
+ locale.setNumberOptions ( locale.numberOptions () |= QLocale::NumberOption::OmitGroupSeparator );
2376
+ }
2377
+ else
2378
+ {
2379
+ locale.setNumberOptions ( locale.numberOptions () &= ! QLocale::NumberOption::OmitGroupSeparator );
2380
+ }
2381
+ lblLocaleSample->setText ( tr ( " Sample date: %1 money: %2 int: %3 float: %4" ).arg (
2382
+ QDate::currentDate ().toString ( locale.dateFormat ( QLocale::FormatType::ShortFormat ) ),
2383
+ locale.toCurrencyString ( 1000.00 ),
2384
+ locale.toString ( 1000 ),
2385
+ locale.toString ( 1000.00 , ' f' , 2 ) ) );
2386
+ }
2387
+
2368
2388
void QgsOptions::updateActionsForCurrentColorScheme ( QgsColorScheme *scheme )
2369
2389
{
2370
2390
if ( !scheme )
0 commit comments