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 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfilterlineedit.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsFilterLineEdit : QLineEdit
{
%Docstring(signature="appended")
QLineEdit subclass with built in support for clearing the widget's value and
handling custom null value representations.
When using :py:class:`QgsFilterLineEdit` the :py:func:`~value`, :py:func:`~setValue` and :py:func:`~clearValue` methods should be used
instead of QLineEdit's :py:func:`~text`, :py:func:`~setText` and :py:func:`~clear` methods, and the :py:func:`~valueChanged`
signal should be used instead of :py:func:`~textChanged`.
%End
%TypeHeaderCode
#include "qgsfilterlineedit.h"
%End
%ConvertToSubClassCode
if ( qobject_cast<QgsFilterLineEdit *>( sipCpp ) )
sipType = sipType_QgsFilterLineEdit;
else
sipType = NULL;
%End
public:
enum ClearMode
{
ClearToNull,
ClearToDefault,
};
QgsFilterLineEdit( QWidget *parent /TransferThis/ = 0, const QString &nullValue = QString() );
%Docstring
Constructor for QgsFilterLineEdit.
:param parent: parent widget
:param nullValue: string for representing null values
%End
bool showClearButton() const;
%Docstring
Returns ``True`` if the widget's clear button is visible.
.. seealso:: :py:func:`setShowClearButton`
.. versionadded:: 3.0
%End
void setShowClearButton( bool visible );
%Docstring
Sets whether the widget's clear button is visible.
:param visible: set to ``False`` to hide the clear button
.. seealso:: :py:func:`showClearButton`
.. versionadded:: 3.0
%End
ClearMode clearMode() const;
%Docstring
Returns the clear mode for the widget. The clear mode defines the behavior of the
widget when its value is cleared. This defaults to ClearToNull.
.. seealso:: :py:func:`setClearMode`
.. versionadded:: 3.0
%End
void setClearMode( ClearMode mode );
%Docstring
Sets the clear mode for the widget. The clear mode defines the behavior of the
widget when its value is cleared. This defaults to ClearToNull.
.. seealso:: :py:func:`clearMode`
.. versionadded:: 3.0
%End
void setNullValue( const QString &nullValue );
%Docstring
Sets the string representation for null values in the widget. This does not
affect the values returned for null values by :py:func:`~QgsFilterLineEdit.value`, rather it only affects
the text that is shown to users when the widget's value is null.
:param nullValue: string to show when widget's value is null
.. seealso:: :py:func:`nullValue`
%End
QString nullValue() const;
%Docstring
Returns the string used for representing null values in the widget.
.. seealso:: :py:func:`setNullValue`
.. seealso:: :py:func:`isNull`
%End
void setShowSearchIcon( bool visible );
%Docstring
Define if a search icon shall be shown on the left of the image
when no text is entered
:param visible: set to ``False`` to hide the search icon
.. versionadded:: 3.0
%End
bool showSearchIcon() const;
%Docstring
Returns if a search icon shall be shown on the left of the image
when no text is entered
.. versionadded:: 3.0
%End
void setDefaultValue( const QString &defaultValue );
%Docstring
Sets the default value for the widget. The default value is a value
which the widget will be reset to if it is cleared and the :py:func:`~QgsFilterLineEdit.clearMode`
is equal to ClearToDefault.
:param defaultValue: default value
.. seealso:: :py:func:`defaultValue`
.. seealso:: :py:func:`clearMode`
.. versionadded:: 3.0
%End
QString defaultValue() const;
%Docstring
Returns the default value for the widget. The default value is a value
which the widget will be reset to if it is cleared and the :py:func:`~QgsFilterLineEdit.clearMode`
is equal to ClearToDefault.
.. seealso:: :py:func:`setDefaultValue`
.. seealso:: :py:func:`clearMode`
.. versionadded:: 3.0
%End
void setValue( const QString &value );
%Docstring
Sets the current text for the widget with support for handling null values.
:param value: The text to set. If a null string is provided, the text shown in the
widget will be set to the current :py:func:`~QgsFilterLineEdit.nullValue`.
.. seealso:: :py:func:`value`
%End
QString value() const;
%Docstring
Returns the text of this edit with support for handling null values. If the text
in the widget matches the current :py:func:`~QgsFilterLineEdit.nullValue` then the returned value will be
a null string.
:return: Current text (or null string if it matches the :py:func:`~QgsFilterLineEdit.nullValue` property )
.. seealso:: :py:func:`setValue`
%End
bool isNull() const;
%Docstring
Determine if the current text represents null.
:return: ``True`` if the widget's value is null.
.. seealso:: :py:func:`nullValue`
%End
bool showSpinner() const;
%Docstring
Show a spinner icon. This can be used for search boxes to indicate that
something is going on in the background.
.. versionadded:: 3.0
%End
void setShowSpinner( bool showSpinner );
%Docstring
Show a spinner icon. This can be used for search boxes to indicate that
something is going on in the background.
.. versionadded:: 3.0
%End
bool selectOnFocus() const;
%Docstring
Will select all text when this widget receives the focus.
.. versionadded:: 3.0
%End
void setSelectOnFocus( bool selectOnFocus );
%Docstring
Will select all text when this widget receives the focus.
.. versionadded:: 3.0
%End
virtual bool event( QEvent *event );
%Docstring
Reimplemented to enable/disable the clear action
depending on read-only status
.. versionadded:: 3.0.1
%End
bool hasStateStored() const;
%Docstring
Returns if a state is already saved
.. versionadded:: 3.14
%End
public slots:
virtual void clearValue();
%Docstring
Clears the widget and resets it to the null value.
.. seealso:: :py:func:`nullValue`
.. versionadded:: 3.0
%End
void storeState();
%Docstring
Stores the current state of the line edit (selection and cursor position)
.. versionadded:: 3.14
%End
void restoreState();
%Docstring
Restores the current state of the line edit (selection and cursor position)
.. versionadded:: 3.14
%End
signals:
void cleared();
%Docstring
Emitted when the widget is cleared
.. seealso:: :py:func:`clearValue`
%End
void valueChanged( const QString &value );
%Docstring
Same as :py:func:`~QgsFilterLineEdit.textChanged` but with support for null values.
:param value: The current text or null string if it matches the :py:func:`~QgsFilterLineEdit.nullValue` property.
%End
void showSpinnerChanged();
%Docstring
Show a spinner icon. This can be used for search boxes to indicate that
something is going on in the background.
.. versionadded:: 3.0
%End
void selectOnFocusChanged();
%Docstring
Will select all text when this widget receives the focus.
.. versionadded:: 3.0
%End
protected:
virtual void focusInEvent( QFocusEvent *e );
virtual void mouseReleaseEvent( QMouseEvent *e );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsfilterlineedit.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
|