mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-15 00:02:52 -04:00
438 lines
11 KiB
Plaintext
438 lines
11 KiB
Plaintext
/************************************************************************
|
|
* 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="Since 3.40. Use selectionTextFormat() instead."/;
|
|
%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="Since 3.40. Use setSelectionTextFormat() instead."/;
|
|
%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 *
|
|
************************************************************************/
|