mirror of
				https://github.com/qgis/QGIS.git
				synced 2025-11-04 00:04:25 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			174 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			174 lines
		
	
	
		
			5.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/gui/editorwidgets/qgsdoublespinbox.h                             *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
 | 
						|
%ModuleHeaderCode
 | 
						|
// fix to allow compilation with sip that for some reason
 | 
						|
// doesn't add this include to the file where the code from
 | 
						|
// ConvertToSubClassCode goes.
 | 
						|
#include <qgsdoublespinbox.h>
 | 
						|
%End
 | 
						|
 | 
						|
 | 
						|
class QgsDoubleSpinBox : QDoubleSpinBox
 | 
						|
{
 | 
						|
%Docstring(signature="appended")
 | 
						|
The :py:class:`QgsSpinBox` is a spin box with a clear button that will set the value to the defined clear value.
 | 
						|
The clear value can be either the minimum or the maiximum value of the spin box or a custom value.
 | 
						|
This value can then be handled by a special value text.
 | 
						|
%End
 | 
						|
 | 
						|
%TypeHeaderCode
 | 
						|
#include "qgsdoublespinbox.h"
 | 
						|
%End
 | 
						|
%ConvertToSubClassCode
 | 
						|
    if ( qobject_cast<QgsDoubleSpinBox *>( sipCpp ) )
 | 
						|
      sipType = sipType_QgsDoubleSpinBox;
 | 
						|
    else
 | 
						|
      sipType = NULL;
 | 
						|
%End
 | 
						|
  public:
 | 
						|
 | 
						|
    enum ClearValueMode /BaseType=IntEnum/
 | 
						|
    {
 | 
						|
      MinimumValue,
 | 
						|
      MaximumValue,
 | 
						|
      CustomValue,
 | 
						|
    };
 | 
						|
 | 
						|
    explicit QgsDoubleSpinBox( QWidget *parent /TransferThis/ = 0 );
 | 
						|
%Docstring
 | 
						|
Constructor for QgsDoubleSpinBox.
 | 
						|
 | 
						|
:param parent: parent widget
 | 
						|
%End
 | 
						|
 | 
						|
    void setShowClearButton( bool showClearButton );
 | 
						|
%Docstring
 | 
						|
Sets whether the widget will show a clear button. The clear button
 | 
						|
allows users to reset the widget to a default or empty state.
 | 
						|
 | 
						|
:param showClearButton: set to ``True`` to show the clear button, or ``False`` to hide it
 | 
						|
 | 
						|
.. seealso:: :py:func:`showClearButton`
 | 
						|
%End
 | 
						|
 | 
						|
    bool showClearButton() const;
 | 
						|
%Docstring
 | 
						|
Returns whether the widget is showing a clear button.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setShowClearButton`
 | 
						|
%End
 | 
						|
 | 
						|
    void setExpressionsEnabled( bool enabled );
 | 
						|
%Docstring
 | 
						|
Sets if the widget will allow entry of simple expressions, which are
 | 
						|
evaluated and then discarded.
 | 
						|
 | 
						|
:param enabled: set to ``True`` to allow expression entry
 | 
						|
%End
 | 
						|
 | 
						|
    bool expressionsEnabled() const;
 | 
						|
%Docstring
 | 
						|
Returns whether the widget will allow entry of simple expressions, which are
 | 
						|
evaluated and then discarded.
 | 
						|
 | 
						|
:return: ``True`` if spin box allows expression entry
 | 
						|
%End
 | 
						|
 | 
						|
    virtual void clear();
 | 
						|
 | 
						|
%Docstring
 | 
						|
Sets the current value to the value defined by the clear value.
 | 
						|
%End
 | 
						|
 | 
						|
    void setClearValue( double customValue, const QString &clearValueText = QString() );
 | 
						|
%Docstring
 | 
						|
Defines the clear value as a custom value and will automatically set the clear value mode to CustomValue.
 | 
						|
 | 
						|
:param customValue: defines the numerical value used as the clear value
 | 
						|
:param clearValueText: is the text displayed when the spin box is at the clear value. If not specified, no special value text is used.
 | 
						|
 | 
						|
.. seealso:: :py:func:`clearValue`
 | 
						|
%End
 | 
						|
 | 
						|
    void setClearValueMode( ClearValueMode mode, const QString &clearValueText = QString() );
 | 
						|
%Docstring
 | 
						|
Defines if the clear value should be the minimum or maximum values of the widget or a custom value.
 | 
						|
 | 
						|
:param mode: mode to user for clear value
 | 
						|
:param clearValueText: is the text displayed when the spin box is at the clear value. If not specified, no special value text is used.
 | 
						|
%End
 | 
						|
 | 
						|
    double clearValue() const;
 | 
						|
%Docstring
 | 
						|
Returns the value used when :py:func:`~QgsDoubleSpinBox.clear` is called.
 | 
						|
 | 
						|
.. seealso:: :py:func:`setClearValue`
 | 
						|
%End
 | 
						|
 | 
						|
    void setLineEditAlignment( Qt::Alignment alignment );
 | 
						|
%Docstring
 | 
						|
Set alignment in the embedded line edit widget
 | 
						|
 | 
						|
:param alignment:
 | 
						|
%End
 | 
						|
 | 
						|
    void setSpecialValueText( const QString &txt );
 | 
						|
%Docstring
 | 
						|
Set the special-value text to be ``txt``
 | 
						|
If set, the spin box will display this text instead of a numeric value whenever the current value
 | 
						|
is equal to :py:func:`~QgsDoubleSpinBox.minimum`. Typical use is to indicate that this choice has a special (default) meaning.
 | 
						|
%End
 | 
						|
 | 
						|
    virtual double valueFromText( const QString &text ) const;
 | 
						|
 | 
						|
    virtual QValidator::State validate( QString &input, int &pos ) const;
 | 
						|
 | 
						|
    virtual void paintEvent( QPaintEvent *e );
 | 
						|
 | 
						|
    virtual void stepBy( int steps );
 | 
						|
 | 
						|
 | 
						|
  signals:
 | 
						|
 | 
						|
    void returnPressed();
 | 
						|
%Docstring
 | 
						|
Emitted when the Return or Enter key is used in the line edit.
 | 
						|
 | 
						|
.. versionadded:: 3.40
 | 
						|
%End
 | 
						|
 | 
						|
    void textEdited( const QString &text );
 | 
						|
%Docstring
 | 
						|
Emitted when the the value has been manually edited via line edit.
 | 
						|
 | 
						|
.. versionadded:: 3.40
 | 
						|
%End
 | 
						|
 | 
						|
  protected:
 | 
						|
    virtual void changeEvent( QEvent *event );
 | 
						|
 | 
						|
    virtual void wheelEvent( QWheelEvent *event );
 | 
						|
 | 
						|
    virtual void timerEvent( QTimerEvent *event );
 | 
						|
 | 
						|
 | 
						|
};
 | 
						|
 | 
						|
/************************************************************************
 | 
						|
 * This file has been generated automatically from                      *
 | 
						|
 *                                                                      *
 | 
						|
 * src/gui/editorwidgets/qgsdoublespinbox.h                             *
 | 
						|
 *                                                                      *
 | 
						|
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 | 
						|
 ************************************************************************/
 |