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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsattributetableconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsAttributeTableConfig
{
%Docstring(signature="appended")
This is a container for configuration of the attribute table. The
configuration is specific for one vector layer.
%End
%TypeHeaderCode
#include "qgsattributetableconfig.h"
%End
public:
enum Type /BaseType=IntEnum/
{
Field,
Action
};
struct ColumnConfig
{
ColumnConfig();
QgsAttributeTableConfig::Type type;
QString name;
bool hidden;
int width;
};
enum ActionWidgetStyle /BaseType=IntEnum/
{
ButtonList,
DropDown
};
QgsAttributeTableConfig();
QVector<QgsAttributeTableConfig::ColumnConfig> columns() const;
%Docstring
Gets the list with all columns and their configuration. The list order
defines the order of appearance.
%End
bool isEmpty() const;
%Docstring
Returns ``True`` if the configuration is empty, ie it contains no
columns.
.. seealso:: :py:func:`size`
%End
int size() const;
%Docstring
Returns the number of columns in the configuration.
.. versionadded:: 3.22
%End
Py_ssize_t __len__() const;
%MethodCode
sipRes = sipCpp->size();
%End
int mapVisibleColumnToIndex( int visibleColumn ) const;
%Docstring
Maps a visible column index to its original column index.
:param visibleColumn: index of visible column
:return: corresponding index when hidden columns are considered
%End
void setColumns( const QVector<QgsAttributeTableConfig::ColumnConfig> &columns );
%Docstring
Set the list of columns visible in the attribute table. The list order
defines the order of appearance.
%End
void update( const QgsFields &fields );
%Docstring
Update the configuration with the given fields. Any field which is
present in the configuration but not present in the parameter fields
will be removed. Any field which is in the parameter fields but not in
the configuration will be appended.
%End
bool actionWidgetVisible() const;
%Docstring
Returns ``True`` if the action widget is visible
%End
void setActionWidgetVisible( bool visible );
%Docstring
Set if the action widget is visible
%End
ActionWidgetStyle actionWidgetStyle() const;
%Docstring
Gets the style of the action widget
%End
void setActionWidgetStyle( ActionWidgetStyle actionWidgetStyle );
%Docstring
Set the style of the action widget
%End
void writeXml( QDomNode &node ) const;
%Docstring
Serialize to XML on layer save
%End
void readXml( const QDomNode &node );
%Docstring
Deserialize to XML on layer load
%End
QString sortExpression() const;
%Docstring
Gets the expression used for sorting.
%End
void setSortExpression( const QString &sortExpression );
%Docstring
Set the sort expression used for sorting.
%End
int columnWidth( int column ) const;
%Docstring
Returns the width of a column, or -1 if column should use default width.
:param column: column index
:raises IndexError: if the column is not found
.. seealso:: :py:func:`setColumnWidth`
%End
%MethodCode
{
if ( a0 < 0 || a0 >= sipCpp->size() )
{
PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
sipIsErr = 1;
}
else
{
return PyLong_FromLong( sipCpp->columnWidth( a0 ) );
}
}
%End
void setColumnWidth( int column, int width );
%Docstring
Sets the width of a column.
:param column: column index
:param width: column width in pixels, or -1 if column should use default
width
:raises IndexError: if the column is not found
.. seealso:: :py:func:`columnWidth`
%End
%MethodCode
if ( a0 < 0 || a0 >= sipCpp->size() )
{
PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
sipIsErr = 1;
}
else
{
sipCpp->setColumnWidth( a0, a1 );
}
%End
bool columnHidden( int column ) const;
%Docstring
Returns ``True`` if the specified column is hidden.
:param column: column index
:raises IndexError: if the column is not found
.. seealso:: :py:func:`setColumnHidden`
%End
%MethodCode
{
if ( a0 < 0 || a0 >= sipCpp->size() )
{
PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
sipIsErr = 1;
}
else
{
return PyBool_FromLong( sipCpp->columnHidden( a0 ) );
}
}
%End
void setColumnHidden( int column, bool hidden );
%Docstring
Sets whether the specified column should be hidden.
:param column: column index
:param hidden: set to ``True`` to hide column
:raises IndexError: if the column is not found
.. seealso:: :py:func:`columnHidden`
%End
%MethodCode
if ( a0 < 0 || a0 >= sipCpp->size() )
{
PyErr_SetString( PyExc_IndexError, QByteArray::number( a0 ) );
sipIsErr = 1;
}
else
{
sipCpp->setColumnHidden( a0, a1 );
}
%End
Qt::SortOrder sortOrder() const;
%Docstring
Gets the sort order
%End
void setSortOrder( Qt::SortOrder sortOrder );
%Docstring
Set the sort order
%End
bool hasSameColumns( const QgsAttributeTableConfig &other ) const;
%Docstring
Compare this configuration's columns name, type, and order to ``other``.
The column's width is not considered.
%End
bool operator!= ( const QgsAttributeTableConfig &other ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsattributetableconfig.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|