mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
This allows text formats to store data defined settings, allowing them to be used wherever the text renderer is (e.g. in layout scalebar text).
301 lines
7.9 KiB
Plaintext
301 lines
7.9 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/qgstextformatwidget.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsTextFormatWidget : QWidget, QgsExpressionContextGenerator, protected Ui::QgsTextFormatWidgetBase
|
|
{
|
|
%Docstring
|
|
A widget for customizing text formatting settings.
|
|
|
|
QgsTextFormatWidget provides a widget for controlling the appearance of text rendered
|
|
using QgsTextRenderer. The widget includes all settings contained within
|
|
a QgsTextFormat, including shadow, background and buffer.
|
|
|
|
Additionally, the widget can handle labeling settings due to the large overlap between
|
|
the text renderer settings and the labeling settings. This mode is possible by
|
|
subclassing QgsTextFormatWidget and calling the protected constructor with a mode
|
|
of Labeling.
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgstextformatwidget.h"
|
|
%End
|
|
public:
|
|
|
|
QgsTextFormatWidget( const QgsTextFormat &format = QgsTextFormat(), QgsMapCanvas *mapCanvas = 0, QWidget *parent /TransferThis/ = 0,
|
|
QgsVectorLayer *layer = 0 );
|
|
%Docstring
|
|
Constructor for QgsTextFormatWidget.
|
|
|
|
:param format: initial formatting settings to show in widget
|
|
:param mapCanvas: associated map canvas
|
|
:param parent: parent widget
|
|
:param layer: associated vector layer
|
|
%End
|
|
|
|
~QgsTextFormatWidget();
|
|
|
|
QgsTextFormat format( bool includeDataDefinedProperties = true ) const;
|
|
%Docstring
|
|
Returns the current formatting settings defined by the widget.
|
|
|
|
If ``includateDataDefinedProperties`` is ``True``, then data defined properties
|
|
specified in the widget will be included in the format definition.
|
|
%End
|
|
|
|
void setFormat( const QgsTextFormat &format );
|
|
%Docstring
|
|
Sets the current formatting settings
|
|
|
|
.. versionadded:: 3.2
|
|
%End
|
|
|
|
virtual void setContext( const QgsSymbolWidgetContext &context );
|
|
%Docstring
|
|
Sets the ``context`` in which the widget is shown, e.g., the associated map canvas and expression contexts.
|
|
|
|
.. seealso:: :py:func:`context`
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
QgsSymbolWidgetContext context() const;
|
|
%Docstring
|
|
Returns the context in which the widget is shown, e.g., the associated map canvas and expression contexts.
|
|
|
|
.. seealso:: :py:func:`setContext`
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
void deactivateField( QgsPalLayerSettings::Property key );
|
|
%Docstring
|
|
Deactivate a field from data defined properties and update the
|
|
corresponding button.
|
|
|
|
:param key: The property key to deactivate
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
public slots:
|
|
|
|
void setDockMode( bool enabled );
|
|
%Docstring
|
|
Sets whether the widget should be shown in a compact dock mode.
|
|
|
|
:param enabled: set to ``True`` to show in dock mode.
|
|
%End
|
|
|
|
signals:
|
|
|
|
void widgetChanged();
|
|
%Docstring
|
|
Emitted when the text format defined by the widget changes
|
|
%End
|
|
|
|
void auxiliaryFieldCreated();
|
|
%Docstring
|
|
Emitted when an auxiliary field is creatd in the widget.
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
protected:
|
|
|
|
enum Mode
|
|
{
|
|
Text,
|
|
Labeling,
|
|
};
|
|
|
|
QgsTextFormatWidget( QgsMapCanvas *mapCanvas, QWidget *parent /TransferThis/, Mode mode, QgsVectorLayer *layer = 0 );
|
|
%Docstring
|
|
Constructor for QgsTextFormatWidget.
|
|
|
|
:param mapCanvas: associated map canvas
|
|
:param parent: parent widget
|
|
:param mode: widget mode
|
|
:param layer: associated vector layer
|
|
%End
|
|
|
|
void updateWidgetForFormat( const QgsTextFormat &format );
|
|
%Docstring
|
|
Updates the widget's state to reflect the settings in a :py:class:`QgsTextFormat`.
|
|
|
|
:param format: source format
|
|
%End
|
|
|
|
void setPreviewBackground( const QColor &color );
|
|
%Docstring
|
|
Sets the background color for the text preview widget.
|
|
|
|
:param color: background color
|
|
%End
|
|
|
|
void enableDataDefinedAlignment( bool enable );
|
|
%Docstring
|
|
Controls whether data defined alignment buttons are enabled.
|
|
|
|
:param enable: set to ``True`` to enable alignment controls
|
|
%End
|
|
|
|
virtual QgsExpressionContext createExpressionContext() const;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void updateLinePlacementOptions();
|
|
%Docstring
|
|
Updates line placement options to reflect current state of widget
|
|
%End
|
|
|
|
void updatePlacementWidgets();
|
|
%Docstring
|
|
Updates label placement options to reflect current state of widget
|
|
%End
|
|
|
|
virtual void setFormatFromStyle( const QString &name, QgsStyle::StyleEntity type );
|
|
%Docstring
|
|
Sets the current text settings from a style entry.
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
virtual void saveFormat();
|
|
%Docstring
|
|
Saves the current text settings to a style entry.
|
|
%End
|
|
|
|
void updatePreview();
|
|
%Docstring
|
|
Updates the text preview.
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
class QgsTextFormatDialog : QDialog
|
|
{
|
|
%Docstring
|
|
A simple dialog for customizing text formatting settings.
|
|
|
|
QgsTextFormatDialog provides a dialog for controlling the appearance of text rendered
|
|
using :py:class:`QgsTextRenderer`. The dialog includes all settings contained within
|
|
a :py:class:`QgsTextFormat`, including shadow, background and buffer.
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgstextformatwidget.h"
|
|
%End
|
|
public:
|
|
|
|
QgsTextFormatDialog( const QgsTextFormat &format, QgsMapCanvas *mapCanvas = 0, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags, QgsVectorLayer *layer = 0 );
|
|
%Docstring
|
|
Constructor for QgsTextFormatDialog.
|
|
|
|
:param format: initial format settings to show in dialog
|
|
:param mapCanvas: optional associated map canvas
|
|
:param parent: parent widget
|
|
:param fl: window flags for dialog
|
|
:param layer: associated vector layer
|
|
%End
|
|
|
|
QgsTextFormat format() const;
|
|
%Docstring
|
|
Returns the current formatting settings defined by the widget.
|
|
%End
|
|
|
|
void setContext( const QgsSymbolWidgetContext &context );
|
|
%Docstring
|
|
Sets the ``context`` in which the widget is shown, e.g., the associated map canvas and expression contexts.
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
QDialogButtonBox *buttonBox() const;
|
|
%Docstring
|
|
Returns a reference to the dialog's button box.
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
};
|
|
|
|
|
|
class QgsTextFormatPanelWidget : QgsPanelWidgetWrapper
|
|
{
|
|
%Docstring
|
|
A panel widget for customizing text formatting settings.
|
|
|
|
QgsTextFormatPanelWidget provides a panel widget for controlling the appearance of text rendered
|
|
using :py:class:`QgsTextRenderer`. The dialog includes all settings contained within
|
|
a :py:class:`QgsTextFormat`, including shadow, background and buffer.
|
|
|
|
.. versionadded:: 3.0
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgstextformatwidget.h"
|
|
%End
|
|
public:
|
|
|
|
QgsTextFormatPanelWidget( const QgsTextFormat &format, QgsMapCanvas *mapCanvas = 0, QWidget *parent /TransferThis/ = 0, QgsVectorLayer *layer = 0 );
|
|
%Docstring
|
|
Constructor for QgsTextFormatPanelWidget.
|
|
|
|
:param format: initial format settings to show in dialog
|
|
:param mapCanvas: optional associated map canvas
|
|
:param parent: parent widget
|
|
:param layer: associated layer
|
|
%End
|
|
|
|
QgsTextFormat format() const;
|
|
%Docstring
|
|
Returns the current formatting settings defined by the widget.
|
|
%End
|
|
|
|
void setContext( const QgsSymbolWidgetContext &context );
|
|
%Docstring
|
|
Sets the ``context`` in which the widget is shown, e.g., the associated map canvas and expression contexts.
|
|
|
|
.. versionadded:: 3.10
|
|
%End
|
|
|
|
virtual void setDockMode( bool dockMode );
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/qgstextformatwidget.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|