1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/editorwidgets/qgsspinbox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
%ModuleHeaderCode
// fix to allow compilation with sip 4.7 that for some reason
// doesn't add this include to the file where the code from
// ConvertToSubClassCode goes.
#include <qgsspinbox.h>
%End
class QgsSpinBox : QSpinBox
{
%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 "qgsspinbox.h"
%End
%ConvertToSubClassCode
if ( qobject_cast<QgsSpinBox *>( sipCpp ) )
sipType = sipType_QgsSpinBox;
else
sipType = NULL;
%End
public:
enum ClearValueMode /BaseType=IntEnum/
{
MinimumValue,
MaximumValue,
CustomValue,
};
explicit QgsSpinBox( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsSpinBox.
: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( int 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:`setClearValue`
%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
int clearValue() const;
%Docstring
Returns the value used when :py:func:`~QgsSpinBox.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:`~QgsSpinBox.minimum`. Typical use is to indicate
that this choice has a special (default) meaning.
%End
virtual int valueFromText( const QString &text ) const;
virtual QValidator::State validate( QString &input, int &pos ) const;
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 paintEvent( QPaintEvent *event );
virtual void wheelEvent( QWheelEvent *event );
virtual void timerEvent( QTimerEvent *event );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/editorwidgets/qgsspinbox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|