mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-10-31 00:06:02 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			183 lines
		
	
	
		
			5.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			183 lines
		
	
	
		
			5.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| /************************************************************************
 | |
|  * This file has been generated automatically from                      *
 | |
|  *                                                                      *
 | |
|  * src/gui/qgsscalecombobox.h                                           *
 | |
|  *                                                                      *
 | |
|  * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | |
|  ************************************************************************/
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| class QgsScaleComboBox : QComboBox
 | |
| {
 | |
| %Docstring(signature="appended")
 | |
| A combobox which lets the user select map scale from predefined list
 | |
| and highlights nearest to current scale value
 | |
| %End
 | |
| 
 | |
| %TypeHeaderCode
 | |
| #include "qgsscalecombobox.h"
 | |
| %End
 | |
|   public:
 | |
| 
 | |
|     QgsScaleComboBox( QWidget *parent /TransferThis/ = 0 );
 | |
| %Docstring
 | |
| Constructor for QgsScaleComboBox.
 | |
| %End
 | |
| 
 | |
|     QString scaleString() const;
 | |
| %Docstring
 | |
| Returns the selected scale as a string, e.g. "1:150".
 | |
| 
 | |
| .. seealso:: :py:func:`setScaleString`
 | |
| %End
 | |
| 
 | |
|     bool setScaleString( const QString &string );
 | |
| %Docstring
 | |
| Set the selected scale from a ``string``, e.g. "1:150".
 | |
| 
 | |
| .. seealso:: :py:func:`scaleString`
 | |
| %End
 | |
| 
 | |
|     double scale() const;
 | |
| %Docstring
 | |
| Returns the selected scale as a double.
 | |
| The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
 | |
| 
 | |
| .. seealso:: :py:func:`setScale`
 | |
| %End
 | |
| 
 | |
|     bool isNull() const;
 | |
| %Docstring
 | |
| Returns ``True`` if the combo box is currently set to a "null" value.
 | |
| 
 | |
| .. seealso:: :py:func:`setAllowNull`
 | |
| 
 | |
| .. seealso:: :py:func:`setNull`
 | |
| 
 | |
| .. versionadded:: 3.8
 | |
| %End
 | |
| 
 | |
|     double minScale() const;
 | |
| %Docstring
 | |
| Returns the minimum scale, or 0 if no minimum scale set.
 | |
| The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
 | |
| Any scale lower than the minimum scale will automatically be converted to the minimum scale.
 | |
| Except for 0 which is always allowed.
 | |
| %End
 | |
| 
 | |
|     static QString toString( double scale );
 | |
| %Docstring
 | |
| Helper function to convert a ``scale`` double to scale string.
 | |
| The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
 | |
| 
 | |
| The returned string will be rounded (e.g. 1:1000, not 1:1000.345).
 | |
| 
 | |
| .. seealso:: :py:func:`toDouble`
 | |
| %End
 | |
| 
 | |
|     static double toDouble( const QString &string, bool *ok = 0 );
 | |
| %Docstring
 | |
| Helper function to convert a scale ``string`` to double.
 | |
| The returned value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
 | |
| If specified, ``ok`` will be set to ``True`` if the string was successfully interpreted as a scale.
 | |
| 
 | |
| .. seealso:: :py:func:`toString`
 | |
| %End
 | |
| 
 | |
|     void setAllowNull( bool allowNull );
 | |
| %Docstring
 | |
| Sets whether the scale combobox can be set to a NULL value.
 | |
| 
 | |
| .. seealso:: :py:func:`allowNull`
 | |
| 
 | |
| .. seealso:: :py:func:`isNull`
 | |
| 
 | |
| .. seealso:: :py:func:`setNull`
 | |
| 
 | |
| .. versionadded:: 3.8
 | |
| %End
 | |
| 
 | |
|     bool allowNull() const;
 | |
| %Docstring
 | |
| Returns ``True`` if the combobox can be set to a NULL value.
 | |
| 
 | |
| .. seealso:: :py:func:`setAllowNull`
 | |
| 
 | |
| .. seealso:: :py:func:`isNull`
 | |
| 
 | |
| .. seealso:: :py:func:`setNull`
 | |
| 
 | |
| .. versionadded:: 3.8
 | |
| %End
 | |
| 
 | |
|     void setPredefinedScales( const QVector< double > &scales );
 | |
| %Docstring
 | |
| Sets the list of predefined ``scales`` to show in the combobox. List elements
 | |
| are expected to be scale denominators, e.g. 1000.0 for a 1:1000 map.
 | |
| 
 | |
| If ``scales`` is empty then the default user scale options will be used instead.
 | |
| 
 | |
| .. versionadded:: 3.38
 | |
| %End
 | |
| 
 | |
|   signals:
 | |
| 
 | |
|     void scaleChanged( double scale );
 | |
| %Docstring
 | |
| Emitted when *user* has finished editing/selecting a new scale.
 | |
| The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
 | |
| %End
 | |
| 
 | |
|   public slots:
 | |
| 
 | |
|     void updateScales( const QStringList &scales = QStringList() );
 | |
| %Docstring
 | |
| Sets the list of predefined ``scales`` to show in the combobox. List elements
 | |
| are expected to be valid scale strings, such as "1:1000000".
 | |
| %End
 | |
| 
 | |
|     void setScale( double scale );
 | |
| %Docstring
 | |
| Set the selected scale from a double.
 | |
| The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
 | |
| 
 | |
| .. seealso:: :py:func:`scale`
 | |
| %End
 | |
| 
 | |
|     void setMinScale( double scale );
 | |
| %Docstring
 | |
| Set the minimum allowed ``scale``. Set to 0 to disable the minimum scale.
 | |
| The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
 | |
| Any scale lower than the minimum scale will automatically be converted to the minimum scale.
 | |
| Except for 0 which is always allowed.
 | |
| %End
 | |
| 
 | |
|     void setNull();
 | |
| %Docstring
 | |
| Sets the combo box to the null value.
 | |
| 
 | |
| This only has an effect if :py:func:`~QgsScaleComboBox.allowNull` is ``True``.
 | |
| 
 | |
| .. seealso:: :py:func:`allowNull`
 | |
| 
 | |
| .. seealso:: :py:func:`isNull`
 | |
| 
 | |
| .. versionadded:: 3.8
 | |
| %End
 | |
| 
 | |
|   protected:
 | |
|     virtual void showPopup();
 | |
| 
 | |
| 
 | |
| };
 | |
| 
 | |
| /************************************************************************
 | |
|  * This file has been generated automatically from                      *
 | |
|  *                                                                      *
 | |
|  * src/gui/qgsscalecombobox.h                                           *
 | |
|  *                                                                      *
 | |
|  * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | |
|  ************************************************************************/
 |