QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsnumericformatwidget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsnumericformatwidget.cpp
3  --------------------------
4  begin : January 2020
5  copyright : (C) 2020 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "qgsnumericformatwidget.h"
17 #include "qgsbasicnumericformat.h"
24 #include "qgsgui.h"
25 #include "qgis.h"
26 #include <QDialogButtonBox>
27 
28 //
29 // QgsBasicNumericFormatWidget
30 //
32  : QgsNumericFormatWidget( parent )
33 {
34  setupUi( this );
35  setFormat( format->clone() );
36 
37  mDecimalsSpinBox->setClearValue( 6 );
38  mThousandsLineEdit->setShowClearButton( true );
39  mDecimalLineEdit->setShowClearButton( true );
40 
41  connect( mShowPlusCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
42  {
43  mFormat->setShowPlusSign( checked );
44  if ( !mBlockSignals )
45  emit changed();
46  } );
47 
48  connect( mShowTrailingZerosCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
49  {
50  mFormat->setShowTrailingZeros( checked );
51  if ( !mBlockSignals )
52  emit changed();
53  } );
54 
55  connect( mShowThousandsCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
56  {
57  mFormat->setShowThousandsSeparator( checked );
58  if ( !mBlockSignals )
59  emit changed();
60  } );
61 
62  connect( mDecimalsSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [ = ]( int value )
63  {
64  mFormat->setNumberDecimalPlaces( value );
65  if ( !mBlockSignals )
66  emit changed();
67  } );
68 
69  connect( mRadDecimalPlaces, &QRadioButton::toggled, this, [ = ]( bool checked )
70  {
71  if ( !checked )
72  return;
73 
74  mFormat->setRoundingType( QgsBasicNumericFormat::DecimalPlaces );
75  if ( !mBlockSignals )
76  emit changed();
77  } );
78 
79  connect( mRadSignificantFigures, &QRadioButton::toggled, this, [ = ]( bool checked )
80  {
81  if ( !checked )
82  return;
83 
84  mFormat->setRoundingType( QgsBasicNumericFormat::SignificantFigures );
85  if ( !mBlockSignals )
86  emit changed();
87  } );
88 
89  connect( mThousandsLineEdit, &QLineEdit::textChanged, this, [ = ]( const QString & text )
90  {
91  mFormat->setThousandsSeparator( text.isEmpty() ? QChar() : text.at( 0 ) );
92  if ( !mBlockSignals )
93  emit changed();
94  } );
95 
96  connect( mDecimalLineEdit, &QLineEdit::textChanged, this, [ = ]( const QString & text )
97  {
98  mFormat->setDecimalSeparator( text.isEmpty() ? QChar() : text.at( 0 ) );
99  if ( !mBlockSignals )
100  emit changed();
101  } );
102 }
103 
105 
107 {
108  mFormat.reset( static_cast< QgsBasicNumericFormat * >( format ) );
109 
110  mBlockSignals = true;
111  mDecimalsSpinBox->setValue( mFormat->numberDecimalPlaces() );
112  mShowPlusCheckBox->setChecked( mFormat->showPlusSign() );
113  mShowTrailingZerosCheckBox->setChecked( mFormat->showTrailingZeros() );
114  mShowThousandsCheckBox->setChecked( mFormat->showThousandsSeparator() );
115  mThousandsLineEdit->setText( mFormat->thousandsSeparator().isNull() ? QString() : mFormat->thousandsSeparator() );
116  mDecimalLineEdit->setText( mFormat->decimalSeparator().isNull() ? QString() : mFormat->decimalSeparator() );
117  switch ( mFormat->roundingType() )
118  {
120  mRadDecimalPlaces->setChecked( true );
121  break;
122 
124  mRadSignificantFigures->setChecked( true );
125  break;
126  }
127 
128  mBlockSignals = false;
129 }
130 
132 {
133  return mFormat->clone();
134 }
135 
136 //
137 // QgsBearingNumericFormatWidget
138 //
139 
141  : QgsNumericFormatWidget( parent )
142 {
143  setupUi( this );
144 
145  mDecimalsSpinBox->setClearValue( 6 );
146  mFormatComboBox->addItem( QObject::tr( "0 to 180°, with E/W suffix" ), QgsBearingNumericFormat::UseRange0To180WithEWDirectionalSuffix );
147  mFormatComboBox->addItem( QObject::tr( "-180 to +180°" ), QgsBearingNumericFormat::UseRangeNegative180ToPositive180 );
148  mFormatComboBox->addItem( QObject::tr( "0 to 360°" ), QgsBearingNumericFormat::UseRange0To360 );
149 
150  setFormat( format->clone() );
151 
152  connect( mShowTrailingZerosCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
153  {
154  mFormat->setShowTrailingZeros( checked );
155  if ( !mBlockSignals )
156  emit changed();
157  } );
158 
159  connect( mDecimalsSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [ = ]( int value )
160  {
161  mFormat->setNumberDecimalPlaces( value );
162  if ( !mBlockSignals )
163  emit changed();
164  } );
165 
166  connect( mFormatComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [ = ]( int )
167  {
168  mFormat->setDirectionFormat( static_cast < QgsBearingNumericFormat::FormatDirectionOption >( mFormatComboBox->currentData().toInt() ) );
169  if ( !mBlockSignals )
170  emit changed();
171  } );
172 }
173 
175 
177 {
178  mFormat.reset( static_cast< QgsBearingNumericFormat * >( format ) );
179 
180  mBlockSignals = true;
181  mDecimalsSpinBox->setValue( mFormat->numberDecimalPlaces() );
182  mShowTrailingZerosCheckBox->setChecked( mFormat->showTrailingZeros() );
183  mFormatComboBox->setCurrentIndex( mFormatComboBox->findData( static_cast< int >( mFormat->directionFormat() ) ) );
184  mBlockSignals = false;
185 }
186 
188 {
189  return mFormat->clone();
190 }
191 
192 //
193 // QgsBearingNumericFormatDialog
194 //
195 
197  : QDialog( parent )
198 {
199  setLayout( new QVBoxLayout() );
200  mWidget = new QgsBearingNumericFormatWidget( format );
201  QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Ok );
202 
203  connect( buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept );
204  connect( buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
205 
206  layout()->addWidget( mWidget );
207  layout()->addWidget( buttonBox );
208 
209  connect( mWidget, &QgsPanelWidget::panelAccepted, this, &QDialog::reject );
210 
211  setObjectName( QStringLiteral( "QgsBearingNumericFormatDialog" ) );
213 }
214 
216 {
217  return static_cast< QgsBearingNumericFormat * >( mWidget->format() );
218 }
219 
220 
221 
222 
223 
224 //
225 // QgsGeographicCoordinateNumericFormatWidget
226 //
227 
229  : QgsNumericFormatWidget( parent )
230 {
231  setupUi( this );
232 
233  mDecimalsSpinBox->setClearValue( 6 );
234  mFormatComboBox->addItem( QObject::tr( "Decimal Degrees" ), static_cast< int >( QgsGeographicCoordinateNumericFormat::AngleFormat::DecimalDegrees ) );
235  mFormatComboBox->addItem( QObject::tr( "Degrees, Minutes" ), static_cast< int >( QgsGeographicCoordinateNumericFormat::AngleFormat::DegreesMinutes ) );
236  mFormatComboBox->addItem( QObject::tr( "Degrees, Minutes, Seconds" ), static_cast< int >( QgsGeographicCoordinateNumericFormat::AngleFormat::DegreesMinutesSeconds ) );
237 
238  if ( hidePrecisionControl )
239  {
240  mLabelDecimalPlaces->hide();
241  mDecimalsSpinBox->hide();
242  }
243  setFormat( format->clone() );
244 
245  connect( mShowTrailingZerosCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
246  {
247  mFormat->setShowTrailingZeros( checked );
248  if ( !mBlockSignals )
249  emit changed();
250  } );
251 
252  connect( mShowDirectionalSuffixCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
253  {
254  mFormat->setShowDirectionalSuffix( checked );
255  if ( !mBlockSignals )
256  emit changed();
257  } );
258 
259  connect( mShowLeadingZerosCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
260  {
261  mFormat->setShowLeadingZeros( checked );
262  if ( !mBlockSignals )
263  emit changed();
264  } );
265 
266  connect( mShowLeadingZerosForDegreesCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
267  {
268  mFormat->setShowDegreeLeadingZeros( checked );
269  if ( !mBlockSignals )
270  emit changed();
271  } );
272 
273  connect( mDecimalsSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [ = ]( int value )
274  {
275  mFormat->setNumberDecimalPlaces( value );
276  if ( !mBlockSignals )
277  emit changed();
278  } );
279 
280  connect( mFormatComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [ = ]( int )
281  {
282  mFormat->setAngleFormat( static_cast < QgsGeographicCoordinateNumericFormat::AngleFormat >( mFormatComboBox->currentData().toInt() ) );
283  if ( !mBlockSignals )
284  emit changed();
285  } );
286 }
287 
289 
291 {
292  mFormat.reset( static_cast< QgsGeographicCoordinateNumericFormat * >( format ) );
293 
294  mBlockSignals = true;
295  mDecimalsSpinBox->setValue( mFormat->numberDecimalPlaces() );
296  mShowTrailingZerosCheckBox->setChecked( mFormat->showTrailingZeros() );
297  mShowDirectionalSuffixCheckBox->setChecked( mFormat->showDirectionalSuffix() );
298  mShowLeadingZerosCheckBox->setChecked( mFormat->showLeadingZeros() );
299  mShowLeadingZerosForDegreesCheckBox->setChecked( mFormat->showDegreeLeadingZeros() );
300  mFormatComboBox->setCurrentIndex( mFormatComboBox->findData( static_cast< int >( mFormat->angleFormat() ) ) );
301  mBlockSignals = false;
302 }
303 
305 {
306  return mFormat->clone();
307 }
308 
309 //
310 // QgsGeographicCoordinateNumericFormatDialog
311 //
312 
314  : QDialog( parent )
315 {
316  setLayout( new QVBoxLayout() );
317  mWidget = new QgsGeographicCoordinateNumericFormatWidget( format, hidePrecisionControl );
318  QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Ok );
319 
320  connect( buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept );
321  connect( buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
322 
323  layout()->addWidget( mWidget );
324  layout()->addWidget( buttonBox );
325 
326  connect( mWidget, &QgsPanelWidget::panelAccepted, this, &QDialog::reject );
327 
328  setObjectName( QStringLiteral( "QgsGeographicCoordinateNumericFormatDialog" ) );
330 }
331 
333 {
334  return static_cast< QgsGeographicCoordinateNumericFormat * >( mWidget->format() );
335 }
336 
337 
338 
339 
340 //
341 // QgsCurrencyNumericFormatWidget
342 //
344  : QgsNumericFormatWidget( parent )
345 {
346  setupUi( this );
347  mDecimalsSpinBox->setClearValue( 2 );
348  setFormat( format->clone() );
349 
350  connect( mShowPlusCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
351  {
352  mFormat->setShowPlusSign( checked );
353  if ( !mBlockSignals )
354  emit changed();
355  } );
356 
357  connect( mShowTrailingZerosCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
358  {
359  mFormat->setShowTrailingZeros( checked );
360  if ( !mBlockSignals )
361  emit changed();
362  } );
363 
364  connect( mShowThousandsCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
365  {
366  mFormat->setShowThousandsSeparator( checked );
367  if ( !mBlockSignals )
368  emit changed();
369  } );
370 
371  connect( mDecimalsSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [ = ]( int value )
372  {
373  mFormat->setNumberDecimalPlaces( value );
374  if ( !mBlockSignals )
375  emit changed();
376  } );
377 
378  connect( mPrefixLineEdit, &QLineEdit::textChanged, this, [ = ]( const QString & text )
379  {
380  mFormat->setPrefix( text );
381  if ( !mBlockSignals )
382  emit changed();
383  } );
384 
385  connect( mSuffixLineEdit, &QLineEdit::textChanged, this, [ = ]( const QString & text )
386  {
387  mFormat->setSuffix( text );
388  if ( !mBlockSignals )
389  emit changed();
390  } );
391 }
392 
394 
396 {
397  mFormat.reset( static_cast< QgsCurrencyNumericFormat * >( format ) );
398 
399  mBlockSignals = true;
400  mDecimalsSpinBox->setValue( mFormat->numberDecimalPlaces() );
401  mShowPlusCheckBox->setChecked( mFormat->showPlusSign() );
402  mShowTrailingZerosCheckBox->setChecked( mFormat->showTrailingZeros() );
403  mShowThousandsCheckBox->setChecked( mFormat->showThousandsSeparator() );
404  mPrefixLineEdit->setText( mFormat->prefix() );
405  mSuffixLineEdit->setText( mFormat->suffix() );
406 
407  mBlockSignals = false;
408 }
409 
411 {
412  return mFormat->clone();
413 }
414 
415 
416 //
417 // QgsPercentageNumericFormatWidget
418 //
419 
421  : QgsNumericFormatWidget( parent )
422 {
423  setupUi( this );
424 
425  mDecimalsSpinBox->setClearValue( 6 );
426  mScalingComboBox->addItem( QObject::tr( "Values are Percentages (e.g. 50)" ), QgsPercentageNumericFormat::ValuesArePercentage );
427  mScalingComboBox->addItem( QObject::tr( "Values are Fractions (e.g. 0.5)" ), QgsPercentageNumericFormat::ValuesAreFractions );
428 
429  setFormat( format->clone() );
430 
431  connect( mShowTrailingZerosCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
432  {
433  mFormat->setShowTrailingZeros( checked );
434  if ( !mBlockSignals )
435  emit changed();
436  } );
437 
438  connect( mShowPlusCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
439  {
440  mFormat->setShowPlusSign( checked );
441  if ( !mBlockSignals )
442  emit changed();
443  } );
444 
445  connect( mShowThousandsCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
446  {
447  mFormat->setShowThousandsSeparator( checked );
448  if ( !mBlockSignals )
449  emit changed();
450  } );
451 
452  connect( mDecimalsSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [ = ]( int value )
453  {
454  mFormat->setNumberDecimalPlaces( value );
455  if ( !mBlockSignals )
456  emit changed();
457  } );
458 
459  connect( mScalingComboBox, qOverload<int>( &QComboBox::currentIndexChanged ), this, [ = ]( int )
460  {
461  mFormat->setInputValues( static_cast < QgsPercentageNumericFormat::InputValues >( mScalingComboBox->currentData().toInt() ) );
462  if ( !mBlockSignals )
463  emit changed();
464  } );
465 }
466 
468 
470 {
471  mFormat.reset( static_cast< QgsPercentageNumericFormat * >( format ) );
472 
473  mBlockSignals = true;
474  mDecimalsSpinBox->setValue( mFormat->numberDecimalPlaces() );
475  mShowPlusCheckBox->setChecked( mFormat->showPlusSign() );
476  mShowTrailingZerosCheckBox->setChecked( mFormat->showTrailingZeros() );
477  mShowThousandsCheckBox->setChecked( mFormat->showThousandsSeparator() );
478  mScalingComboBox->setCurrentIndex( mScalingComboBox->findData( static_cast< int >( mFormat->inputValues() ) ) );
479  mBlockSignals = false;
480 }
481 
483 {
484  return mFormat->clone();
485 }
486 
487 //
488 // QgsScientificNumericFormatWidget
489 //
491  : QgsNumericFormatWidget( parent )
492 {
493  setupUi( this );
494  mDecimalsSpinBox->setClearValue( 6 );
495  setFormat( format->clone() );
496 
497  connect( mShowPlusCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
498  {
499  mFormat->setShowPlusSign( checked );
500  if ( !mBlockSignals )
501  emit changed();
502  } );
503 
504  connect( mShowTrailingZerosCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
505  {
506  mFormat->setShowTrailingZeros( checked );
507  if ( !mBlockSignals )
508  emit changed();
509  } );
510 
511  connect( mDecimalsSpinBox, qOverload<int>( &QSpinBox::valueChanged ), this, [ = ]( int value )
512  {
513  mFormat->setNumberDecimalPlaces( value );
514  if ( !mBlockSignals )
515  emit changed();
516  } );
517 }
518 
520 
522 {
523  mFormat.reset( static_cast< QgsScientificNumericFormat * >( format ) );
524 
525  mBlockSignals = true;
526  mDecimalsSpinBox->setValue( mFormat->numberDecimalPlaces() );
527  mShowPlusCheckBox->setChecked( mFormat->showPlusSign() );
528  mShowTrailingZerosCheckBox->setChecked( mFormat->showTrailingZeros() );
529  mBlockSignals = false;
530 }
531 
533 {
534  return mFormat->clone();
535 }
536 
537 
538 
539 //
540 // QgsFractionNumericFormatWidget
541 //
543  : QgsNumericFormatWidget( parent )
544 {
545  setupUi( this );
546  setFormat( format->clone() );
547 
548  mThousandsLineEdit->setShowClearButton( true );
549 
550  connect( mUseDedicatedUnicodeCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
551  {
552  mFormat->setUseDedicatedUnicodeCharacters( checked );
553  if ( !mBlockSignals )
554  emit changed();
555  } );
556 
557  connect( mUseUnicodeSupersubscriptCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
558  {
559  mFormat->setUseUnicodeSuperSubscript( checked );
560  if ( !mBlockSignals )
561  emit changed();
562  } );
563 
564  connect( mShowPlusCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
565  {
566  mFormat->setShowPlusSign( checked );
567  if ( !mBlockSignals )
568  emit changed();
569  } );
570 
571  connect( mShowThousandsCheckBox, &QCheckBox::toggled, this, [ = ]( bool checked )
572  {
573  mFormat->setShowThousandsSeparator( checked );
574  if ( !mBlockSignals )
575  emit changed();
576  } );
577 
578  connect( mThousandsLineEdit, &QLineEdit::textChanged, this, [ = ]( const QString & text )
579  {
580  mFormat->setThousandsSeparator( text.isEmpty() ? QChar() : text.at( 0 ) );
581  if ( !mBlockSignals )
582  emit changed();
583  } );
584 
585 }
586 
588 
590 {
591  mFormat.reset( static_cast< QgsFractionNumericFormat * >( format ) );
592 
593  mBlockSignals = true;
594  mUseDedicatedUnicodeCheckBox->setChecked( mFormat->useDedicatedUnicodeCharacters() );
595  mUseUnicodeSupersubscriptCheckBox->setChecked( mFormat->useUnicodeSuperSubscript() );
596  mShowPlusCheckBox->setChecked( mFormat->showPlusSign() );
597  mShowThousandsCheckBox->setChecked( mFormat->showThousandsSeparator() );
598  mThousandsLineEdit->setText( mFormat->thousandsSeparator().isNull() ? QString() : mFormat->thousandsSeparator() );
599  mBlockSignals = false;
600 }
601 
603 {
604  return mFormat->clone();
605 }
QgsCurrencyNumericFormatWidget::QgsCurrencyNumericFormatWidget
QgsCurrencyNumericFormatWidget(const QgsNumericFormat *format, QWidget *parent=nullptr)
Constructor for QgsCurrencyNumericFormatWidget, initially showing the specified format.
Definition: qgsnumericformatwidget.cpp:343
QgsBearingNumericFormatDialog::QgsBearingNumericFormatDialog
QgsBearingNumericFormatDialog(const QgsNumericFormat *format, QWidget *parent=nullptr)
Constructor for QgsBearingNumericFormatDialog, initially showing the specified format.
Definition: qgsnumericformatwidget.cpp:196
QgsFractionNumericFormatWidget::QgsFractionNumericFormatWidget
QgsFractionNumericFormatWidget(const QgsNumericFormat *format, QWidget *parent=nullptr)
Constructor for QgsFractionNumericFormatWidget, initially showing the specified format.
Definition: qgsnumericformatwidget.cpp:542
QgsGeographicCoordinateNumericFormatWidget::format
QgsNumericFormat * format() override
Returns the format defined by the current settings in the widget.
Definition: qgsnumericformatwidget.cpp:304
QgsBearingNumericFormat::FormatDirectionOption
FormatDirectionOption
Directional formatting option, which controls how bearing direction is described in the returned stri...
Definition: qgsbearingnumericformat.h:49
QgsGeographicCoordinateNumericFormat
A numeric formatter which returns a text representation of a geographic coordinate (latitude or longi...
Definition: qgscoordinatenumericformat.h:28
QgsCurrencyNumericFormatWidget::format
QgsNumericFormat * format() override
Returns the format defined by the current settings in the widget.
Definition: qgsnumericformatwidget.cpp:410
qgsgui.h
QgsBearingNumericFormatWidget::setFormat
void setFormat(QgsNumericFormat *format) override
Sets the format to show in the widget.
Definition: qgsnumericformatwidget.cpp:176
QgsScientificNumericFormatWidget::QgsScientificNumericFormatWidget
QgsScientificNumericFormatWidget(const QgsNumericFormat *format, QWidget *parent=nullptr)
Constructor for QgsScientificNumericFormatWidget, initially showing the specified format.
Definition: qgsnumericformatwidget.cpp:490
qgsfractionnumericformat.h
qgis.h
QgsPercentageNumericFormat::InputValues
InputValues
Input value format, which specifies the format of the incoming values.
Definition: qgspercentagenumericformat.h:46
QgsBearingNumericFormatWidget::format
QgsNumericFormat * format() override
Returns the format defined by the current settings in the widget.
Definition: qgsnumericformatwidget.cpp:187
QgsNumericFormat
A numeric formatter allows for formatting a numeric value for display, using a variety of different f...
Definition: qgsnumericformat.h:259
qgscurrencynumericformat.h
QgsPercentageNumericFormatWidget::~QgsPercentageNumericFormatWidget
~QgsPercentageNumericFormatWidget() override
QgsNumericFormatWidget
Base class for widgets which allow control over the properties of QgsNumericFormat subclasses.
Definition: qgsnumericformatwidget.h:32
QgsGeographicCoordinateNumericFormat::AngleFormat::DecimalDegrees
@ DecimalDegrees
Decimal degrees, eg 30.7555 degrees.
QgsBasicNumericFormat
A numeric formatter which returns a simple text representation of a value.
Definition: qgsbasicnumericformat.h:31
qgsbearingnumericformat.h
QgsGeographicCoordinateNumericFormatDialog::format
QgsGeographicCoordinateNumericFormat * format()
Returns the format defined by the current settings in the dialog.
Definition: qgsnumericformatwidget.cpp:332
QgsPercentageNumericFormatWidget::setFormat
void setFormat(QgsNumericFormat *format) override
Sets the format to show in the widget.
Definition: qgsnumericformatwidget.cpp:469
QgsPercentageNumericFormat
A numeric formatter which returns a text representation of a percentage value.
Definition: qgspercentagenumericformat.h:28
QgsGui::enableAutoGeometryRestore
static void enableAutoGeometryRestore(QWidget *widget, const QString &key=QString())
Register the widget to allow its position to be automatically saved and restored when open and closed...
Definition: qgsgui.cpp:180
QgsGeographicCoordinateNumericFormatWidget::~QgsGeographicCoordinateNumericFormatWidget
~QgsGeographicCoordinateNumericFormatWidget() override
QgsGeographicCoordinateNumericFormatWidget::setFormat
void setFormat(QgsNumericFormat *format) override
Sets the format to show in the widget.
Definition: qgsnumericformatwidget.cpp:290
QgsBearingNumericFormat::UseRangeNegative180ToPositive180
@ UseRangeNegative180ToPositive180
Return values between -180 and 180.
Definition: qgsbearingnumericformat.h:65
QgsBearingNumericFormatWidget::QgsBearingNumericFormatWidget
QgsBearingNumericFormatWidget(const QgsNumericFormat *format, QWidget *parent=nullptr)
Constructor for QgsBearingNumericFormatWidget, initially showing the specified format.
Definition: qgsnumericformatwidget.cpp:140
QgsPercentageNumericFormatWidget::format
QgsNumericFormat * format() override
Returns the format defined by the current settings in the widget.
Definition: qgsnumericformatwidget.cpp:482
QgsPanelWidget::panelAccepted
void panelAccepted(QgsPanelWidget *panel)
Emitted when the panel is accepted by the user.
QgsCurrencyNumericFormatWidget::~QgsCurrencyNumericFormatWidget
~QgsCurrencyNumericFormatWidget() override
QgsGeographicCoordinateNumericFormatWidget
A widget which allow control over the properties of a QgsGeographicCoordinateNumericFormat.
Definition: qgsnumericformatwidget.h:175
QgsBearingNumericFormatDialog::format
QgsBearingNumericFormat * format()
Returns the format defined by the current settings in the dialog.
Definition: qgsnumericformatwidget.cpp:215
QgsBearingNumericFormatWidget::~QgsBearingNumericFormatWidget
~QgsBearingNumericFormatWidget() override
QgsCurrencyNumericFormatWidget::setFormat
void setFormat(QgsNumericFormat *format) override
Sets the format to show in the widget.
Definition: qgsnumericformatwidget.cpp:395
QgsPercentageNumericFormatWidget::QgsPercentageNumericFormatWidget
QgsPercentageNumericFormatWidget(const QgsNumericFormat *format, QWidget *parent=nullptr)
Constructor for QgsPercentageNumericFormatWidget, initially showing the specified format.
Definition: qgsnumericformatwidget.cpp:420
QgsScientificNumericFormatWidget::format
QgsNumericFormat * format() override
Returns the format defined by the current settings in the widget.
Definition: qgsnumericformatwidget.cpp:532
QgsBasicNumericFormat::SignificantFigures
@ SignificantFigures
Maximum number of significant figures.
Definition: qgsbasicnumericformat.h:67
QgsFractionNumericFormatWidget::setFormat
void setFormat(QgsNumericFormat *format) override
Sets the format to show in the widget.
Definition: qgsnumericformatwidget.cpp:589
QgsPercentageNumericFormat::ValuesArePercentage
@ ValuesArePercentage
Incoming values are percentage values (e.g. 50 for 50%)
Definition: qgspercentagenumericformat.h:61
QgsBearingNumericFormat::UseRange0To180WithEWDirectionalSuffix
@ UseRange0To180WithEWDirectionalSuffix
Return values between 0 and 180, with a E or W directional suffix.
Definition: qgsbearingnumericformat.h:64
QgsBearingNumericFormatWidget
A widget which allow control over the properties of a QgsBearingNumericFormat.
Definition: qgsnumericformatwidget.h:112
qgsscientificnumericformat.h
QgsBasicNumericFormatWidget::~QgsBasicNumericFormatWidget
~QgsBasicNumericFormatWidget() override
QgsScientificNumericFormatWidget::setFormat
void setFormat(QgsNumericFormat *format) override
Sets the format to show in the widget.
Definition: qgsnumericformatwidget.cpp:521
QgsFractionNumericFormat
A numeric formatter which returns a vulgar fractional representation of a decimal value (e....
Definition: qgsfractionnumericformat.h:30
qgsbasicnumericformat.h
QgsGeographicCoordinateNumericFormat::AngleFormat
AngleFormat
Angle format options.
Definition: qgscoordinatenumericformat.h:50
QgsScientificNumericFormat
A numeric formatter which returns a scientific notation representation of a value.
Definition: qgsscientificnumericformat.h:28
QgsBasicNumericFormatWidget::QgsBasicNumericFormatWidget
QgsBasicNumericFormatWidget(const QgsNumericFormat *format, QWidget *parent=nullptr)
Constructor for QgsBasicNumericFormatWidget, initially showing the specified format.
Definition: qgsnumericformatwidget.cpp:31
QgsBearingNumericFormat::UseRange0To360
@ UseRange0To360
Return values between 0 to 360.
Definition: qgsbearingnumericformat.h:66
qgscoordinatenumericformat.h
QgsGeographicCoordinateNumericFormat::AngleFormat::DegreesMinutesSeconds
@ DegreesMinutesSeconds
Degrees, minutes and seconds, eg 30 degrees 45'30.
QgsNumericFormatWidget::changed
void changed()
Emitted whenever the configuration of the numeric format is changed.
QgsGeographicCoordinateNumericFormatDialog::QgsGeographicCoordinateNumericFormatDialog
QgsGeographicCoordinateNumericFormatDialog(const QgsNumericFormat *format, bool hidePrecisionControl=false, QWidget *parent=nullptr)
Constructor for QgsGeographicCoordinateNumericFormatDialog, initially showing the specified format.
Definition: qgsnumericformatwidget.cpp:313
QgsGeographicCoordinateNumericFormatWidget::QgsGeographicCoordinateNumericFormatWidget
QgsGeographicCoordinateNumericFormatWidget(const QgsNumericFormat *format, bool hidePrecisionControl=false, QWidget *parent=nullptr)
Constructor for QgsGeographicCoordinateNumericFormatWidget, initially showing the specified format.
Definition: qgsnumericformatwidget.cpp:228
QgsCurrencyNumericFormat
A numeric formatter which returns a text representation of a currency value.
Definition: qgscurrencynumericformat.h:28
qgsnumericformatwidget.h
QgsBasicNumericFormatWidget::setFormat
void setFormat(QgsNumericFormat *format) override
Sets the format to show in the widget.
Definition: qgsnumericformatwidget.cpp:106
QgsFractionNumericFormatWidget::format
QgsNumericFormat * format() override
Returns the format defined by the current settings in the widget.
Definition: qgsnumericformatwidget.cpp:602
QgsGeographicCoordinateNumericFormat::AngleFormat::DegreesMinutes
@ DegreesMinutes
Degrees and decimal minutes, eg 30 degrees 45.55'.
QgsNumericFormat::clone
virtual QgsNumericFormat * clone() const =0
Clones the format, returning a new object.
QgsScientificNumericFormatWidget::~QgsScientificNumericFormatWidget
~QgsScientificNumericFormatWidget() override
QgsBearingNumericFormat
A numeric formatter which returns a text representation of a direction/bearing.
Definition: qgsbearingnumericformat.h:28
qgspercentagenumericformat.h
QgsBasicNumericFormat::DecimalPlaces
@ DecimalPlaces
Maximum number of decimal places.
Definition: qgsbasicnumericformat.h:66
QgsBasicNumericFormatWidget::format
QgsNumericFormat * format() override
Returns the format defined by the current settings in the widget.
Definition: qgsnumericformatwidget.cpp:131
QgsFractionNumericFormatWidget::~QgsFractionNumericFormatWidget
~QgsFractionNumericFormatWidget() override
QgsPercentageNumericFormat::ValuesAreFractions
@ ValuesAreFractions
Incoming values are numeric fractions (e.g. 0.5 for 50%)
Definition: qgspercentagenumericformat.h:62