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 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/tableeditor/qgstableeditorwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsTableEditorWidget : QTableWidget
{
%Docstring(signature="appended")
A reusable widget for editing simple spreadsheet-style tables.
Table content is retrieved and set using the
:py:class:`QgsTableContents` class. The editor has support for table
foreground and background colors, and numeric formats.
.. versionadded:: 3.12
%End
%TypeHeaderCode
#include "qgstableeditorwidget.h"
%End
public:
QgsTableEditorWidget( QWidget *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsTableEditorWidget with the specified ``parent``
widget.
%End
~QgsTableEditorWidget();
void setTableContents( const QgsTableContents &contents );
%Docstring
Sets the ``contents`` to show in the editor widget.
.. seealso:: :py:func:`tableContents`
%End
QgsTableContents tableContents() const;
%Docstring
Returns the current contents of the editor widget table.
.. seealso:: :py:func:`setTableContents`
%End
void setSelectionNumericFormat( QgsNumericFormat *format /Transfer/ );
%Docstring
Sets the numeric ``format`` to use for the currently selected cells.
Ownership of ``format`` is transferred to the widget.
.. seealso:: :py:func:`selectionNumericFormat`
%End
QgsNumericFormat *selectionNumericFormat();
%Docstring
Returns the numeric format used for the currently selected cells, or
``None`` if the selection has no numeric format set.
If the selected cells have a mix of different formats then ``None`` will
be returned.
.. seealso:: :py:func:`setSelectionNumericFormat`
.. seealso:: :py:func:`hasMixedSelectionNumericFormat`
%End
bool hasMixedSelectionNumericFormat();
%Docstring
Returns ``True`` if the current selection has a mix of numeric formats.
.. seealso:: :py:func:`selectionNumericFormat`
%End
QColor selectionForegroundColor() /Deprecated/;
%Docstring
Returns the foreground color for the currently selected cells.
If the selected cells have a mix of different foreground colors then an
invalid color will be returned.
.. seealso:: :py:func:`setSelectionForegroundColor`
.. seealso:: :py:func:`selectionBackgroundColor`
.. deprecated:: 3.40
Use :py:func:`~QgsTableEditorWidget.selectionTextFormat` instead.
%End
QColor selectionBackgroundColor();
%Docstring
Returns the background color for the currently selected cells.
If the selected cells have a mix of different background colors then an
invalid color will be returned.
.. seealso:: :py:func:`setSelectionBackgroundColor`
.. seealso:: :py:func:`selectionForegroundColor`
%End
Qt::Alignment selectionHorizontalAlignment();
%Docstring
Returns the horizontal alignment for the currently selected cells.
If the returned value contains both horizontal and vertical alignment
flags, then the selected cells have a mix of different horizontal
alignments.
.. seealso:: :py:func:`selectionVerticalAlignment`
%End
Qt::Alignment selectionVerticalAlignment();
%Docstring
Returns the horizontal alignment for the currently selected cells.
If the returned value contains both horizontal and vertical alignment
flags, then the selected cells have a mix of different vertical
alignments.
.. seealso:: :py:func:`selectionVerticalAlignment`
%End
QgsProperty selectionCellProperty();
%Docstring
Returns the :py:class:`QgsProperty` used for the contents of the
currently selected cells.
If the returned value is a default constructed :py:class:`QgsProperty`,
then the selected cells have a mix of different properties.
.. versionadded:: 3.16
%End
QgsTextFormat selectionTextFormat();
%Docstring
Returns the text format for the currently selected cells.
Returns an invalid :py:class:`QgsTextFormat` if the selection has mixed
text format.
.. versionadded:: 3.16
%End
double selectionRowHeight();
%Docstring
Returns the height (in millimeters) of the rows associated with the
current selection, or 0 if an automatic row height is desired, or -1 if
the selection has mixed row heights.
.. seealso:: :py:func:`setSelectionRowHeight`
%End
double selectionColumnWidth();
%Docstring
Returns the width (in millimeters) of the columns associated with the
current selection, or 0 if an automatic column width is desired.
.. seealso:: :py:func:`setSelectionColumnWidth`
%End
double tableRowHeight( int row );
%Docstring
Returns the configured row height for the specified ``row``, or 0 if an
automatic height should be used for the row.
%End
double tableColumnWidth( int column );
%Docstring
Returns the configured column width for the specified ``column``, or 0
if an automatic width should be used for the column.
%End
void setTableRowHeight( int row, double height );
%Docstring
Sets the configured row ``height`` for the specified ``row``. Set
``height`` to 0 if an automatic height should be used for the row.
This should be called after a call to
:py:func:`~QgsTableEditorWidget.setTableContents`.
.. seealso:: :py:func:`tableRowHeight`
%End
void setTableColumnWidth( int column, double width );
%Docstring
Sets the configured column ``width`` for the specified ``column``. Set
``width`` to 0 if an automatic width should be used for the column.
This should be called after a call to
:py:func:`~QgsTableEditorWidget.setTableContents`.
.. seealso:: :py:func:`tableColumnWidth`
%End
QList<int> rowsAssociatedWithSelection();
%Docstring
Returns a list of the rows associated with the current table selected
cells.
.. seealso:: :py:func:`columnsAssociatedWithSelection`
%End
QList<int> columnsAssociatedWithSelection();
%Docstring
Returns a list of the columns associated with the current table selected
cells.
.. seealso:: :py:func:`rowsAssociatedWithSelection`
%End
QVariantList tableHeaders() const;
%Docstring
Returns the table header values.
.. seealso:: :py:func:`setTableHeaders`
%End
bool isHeaderCellSelected() const;
%Docstring
Returns ``True`` if any header cells are selected.
%End
bool canMergeSelection() const;
%Docstring
Returns ``True`` if a selection has been made which can be merged.
.. versionadded:: 3.40
%End
bool canSplitSelection() const;
%Docstring
Returns ``True`` if a selection has been made which can be split.
.. versionadded:: 3.40
%End
public slots:
void insertRowsBelow();
%Docstring
Inserts new rows below the current selection.
.. seealso:: :py:func:`insertRowsAbove`
%End
void insertRowsAbove();
%Docstring
Inserts new rows above the current selection.
.. seealso:: :py:func:`insertRowsBelow`
%End
void insertColumnsBefore();
%Docstring
Inserts new columns before the current selection.
.. seealso:: :py:func:`insertColumnsAfter`
%End
void insertColumnsAfter();
%Docstring
Inserts new columns after the current selection.
.. seealso:: :py:func:`insertColumnsBefore`
%End
void deleteRows();
%Docstring
Deletes all rows associated with the current selected cells.
.. seealso:: :py:func:`deleteColumns`
%End
void deleteColumns();
%Docstring
Deletes all columns associated with the current selected cells.
.. seealso:: :py:func:`deleteRows`
%End
void expandRowSelection();
%Docstring
Expands out the selection to include whole rows associated with the
current selected cells.
.. seealso:: :py:func:`expandColumnSelection`
%End
void expandColumnSelection();
%Docstring
Expands out the selection to include whole columns associated with the
current selected cells.
.. seealso:: :py:func:`expandRowSelection`
%End
void clearSelectedCells();
%Docstring
Clears the contents of the currently selected cells.
%End
void setSelectionForegroundColor( const QColor &color ) /Deprecated/;
%Docstring
Sets the foreground color for the currently selected cells.
.. seealso:: :py:func:`selectionForegroundColor`
.. seealso:: :py:func:`setSelectionBackgroundColor`
.. deprecated:: 3.40
Use :py:func:`~QgsTableEditorWidget.setSelectionTextFormat` instead.
%End
void setSelectionBackgroundColor( const QColor &color );
%Docstring
Sets the background color for the currently selected cells.
.. seealso:: :py:func:`selectionBackgroundColor`
.. seealso:: :py:func:`setSelectionForegroundColor`
%End
void setSelectionHorizontalAlignment( Qt::Alignment alignment );
%Docstring
Sets the horizontal alignment for the currently selected cells.
.. seealso:: :py:func:`selectionHorizontalAlignment`
.. seealso:: :py:func:`setSelectionVerticalAlignment`
.. versionadded:: 3.16
%End
void setSelectionVerticalAlignment( Qt::Alignment alignment );
%Docstring
Sets the vertical alignment for the currently selected cells.
.. seealso:: :py:func:`selectionVerticalAlignment`
.. seealso:: :py:func:`setSelectionHorizontalAlignment`
.. versionadded:: 3.16
%End
void setSelectionCellProperty( const QgsProperty &property );
%Docstring
Sets the cell contents :py:class:`QgsProperty` for the currently
selected cells.
.. versionadded:: 3.16
%End
void setSelectionTextFormat( const QgsTextFormat &format );
%Docstring
Sets the text ``format`` for the selected cells.
.. versionadded:: 3.16
%End
void setSelectionRowHeight( double height );
%Docstring
Sets the row ``height`` (in millimeters) for the currently selected
rows, or 0 for automatic row height.
.. seealso:: :py:func:`setSelectionColumnWidth`
%End
void setSelectionColumnWidth( double height );
%Docstring
Sets the column ``width`` (in millimeters) for the currently selected
columns, or 0 for automatic column width.
.. seealso:: :py:func:`setSelectionRowHeight`
%End
void setIncludeTableHeader( bool included );
%Docstring
Sets whether the table includes a header row.
%End
void setTableHeaders( const QVariantList &headers );
%Docstring
Sets the table ``headers``.
.. seealso:: :py:func:`tableHeaders`
%End
void mergeSelectedCells();
%Docstring
Merges selected table cells.
.. seealso:: :py:func:`splitSelectedCells`
.. versionadded:: 3.40
%End
void splitSelectedCells();
%Docstring
Splits (un-merges) selected table cells.
.. seealso:: :py:func:`mergeSelectedCells`
.. versionadded:: 3.40
%End
protected:
virtual void keyPressEvent( QKeyEvent *event );
signals:
void tableChanged();
%Docstring
Emitted whenever the table contents are changed.
%End
void activeCellChanged();
%Docstring
Emitted whenever the active (or selected) cell changes in the widget.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/tableeditor/qgstableeditorwidget.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|