17#ifndef QGSTEXTFORMATWIDGET_H
18#define QGSTEXTFORMATWIDGET_H
20#include "ui_qgstextformatwidgetbase.h"
29#include <QFontDatabase>
151 void setPreviewBackground(
const QColor &color );
175 void setPropertyOverrideButtonsVisible(
bool visible );
267 std::unique_ptr<QgsPaintEffect> mBufferEffect;
268 std::unique_ptr<QgsPaintEffect> mMaskEffect;
269 std::unique_ptr<QgsPaintEffect> mBackgroundEffect;
270 QColor mPreviewBackgroundColor;
272 QFontDatabase mFontDB;
276 bool mDockMode =
false;
278 bool mLoadSvgParams =
false;
281 QMap<QgsPalLayerSettings::Property, QgsPropertyOverrideButton *> mButtons;
284 void setWidgetMode(
Mode mode );
285 void blockFontChangeSignals(
bool blk );
286 void populateFontCapitalsComboBox();
287 void populateFontStyleComboBox();
288 void updateFont(
const QFont &font );
289 void connectValueChanged(
const QList<QWidget *> &widgets );
294 void optionsStackedWidget_CurrentChanged(
int indx );
295 void showBackgroundRadius(
bool show );
296 void mShapeSVGPathLineEdit_textChanged(
const QString &text );
298 void previewScaleChanged(
double scale );
299 void mFontSizeSpinBox_valueChanged(
double d );
300 void mFontFamilyCmbBx_currentFontChanged(
const QFont &f );
301 void mFontStyleComboBox_currentIndexChanged(
const QString &text );
302 void mFontUnderlineBtn_toggled(
bool ckd );
303 void mFontStrikethroughBtn_toggled(
bool ckd );
304 void kerningToggled(
bool checked );
305 void mFontWordSpacingSpinBox_valueChanged(
double spacing );
306 void mFontLetterSpacingSpinBox_valueChanged(
double spacing );
307 void mFontSizeUnitWidget_changed();
308 void mFontMinPixelSpinBox_valueChanged(
int px );
309 void mFontMaxPixelSpinBox_valueChanged(
int px );
310 void mBufferUnitWidget_changed();
311 void mMaskBufferUnitWidget_changed();
312 void mCoordXDDBtn_changed();
313 void mCoordXDDBtn_activated(
bool isActive );
314 void mCoordYDDBtn_changed();
315 void mCoordYDDBtn_activated(
bool isActive );
316 void mCoordPointDDBtn_changed();
317 void mCoordPointDDBtn_activated(
bool isActive );
318 void mShapeTypeCmbBx_currentIndexChanged(
int index );
319 void mShapeRotationCmbBx_currentIndexChanged(
int index );
320 void mShapeSVGParamsBtn_clicked();
321 void mShapeSVGSelectorBtn_clicked();
322 void mPreviewTextEdit_textChanged(
const QString &text );
323 void mPreviewTextBtn_clicked();
324 void mPreviewBackgroundBtn_colorChanged(
const QColor &color );
325 void mDirectSymbLeftToolBtn_clicked();
326 void mDirectSymbRightToolBtn_clicked();
327 void chkLineOrientationDependent_toggled(
bool active );
328 void mToolButtonConfigureSubstitutes_clicked();
329 void configureTabStops();
330 void collapseSample(
bool collapse );
331 void changeTextColor(
const QColor &color );
332 void changeBufferColor(
const QColor &color );
333 void scrollPreview();
334 void updateSvgWidgets(
const QString &svgPath );
335 void updateAvailableShadowPositions();
336 void updateProperty();
337 void createAuxiliaryField();
338 void updateShapeFrameStatus();
339 void updateBufferFrameStatus();
340 void updateShadowFrameStatus();
341 void updateCalloutFrameStatus();
342 void updateDataDefinedAlignment();
343 void overlapModeChanged();
392 QDialogButtonBox *mButtonBox =
nullptr;
445 bool mBlockSignals =
false;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
A dialog for selecting a single character from a single font.
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Property
Data definable properties.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
A collection of string replacements (specified using QgsStringReplacement objects).
StyleEntity
Enum for Entities involved in a style.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QgsTextFormat format() const
Returns the current formatting settings defined by the widget.
QDialogButtonBox * buttonBox() const
Returns a reference to the dialog's button box.
void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the widget is shown, e.g., the associated map canvas and expression context...
QgsTextFormatDialog(const QgsTextFormat &format, QgsMapCanvas *mapCanvas=nullptr, QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags, QgsMapLayer *layer=nullptr)
Constructor for QgsTextFormatDialog.
void setFormat(const QgsTextFormat &format)
Sets the format to show in the widget.
QgsTextFormatPanelWidget(const QgsTextFormat &format, QgsMapCanvas *mapCanvas=nullptr, QWidget *parent=nullptr, QgsMapLayer *layer=nullptr)
Constructor for QgsTextFormatPanelWidget.
void setDockMode(bool dockMode) override
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
QgsTextFormat format() const
Returns the current formatting settings defined by the widget.
void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the widget is shown, e.g., the associated map canvas and expression context...
A widget for customizing text formatting settings.
void updatePlacementWidgets()
Updates label placement options to reflect current state of widget.
QListWidgetItem * mMaskItem
Mask widget item.
QButtonGroup * mUpsidedownBtnGrp
Upside down labels button group.
int mMinPixelLimit
Pixel size font limit.
QListWidgetItem * mBackgroundItem
Background widget item.
void setDockMode(bool enabled)
Sets whether the widget should be shown in a compact dock mode.
QgsMapCanvas * mMapCanvas
Associated map canvas.
QgsSymbolWidgetContext context() const
Returns the context in which the widget is shown, e.g., the associated map canvas and expression cont...
QgsTextFormatWidget(const QgsTextFormat &format=QgsTextFormat(), QgsMapCanvas *mapCanvas=nullptr, QWidget *parent=nullptr, QgsMapLayer *layer=nullptr)
Constructor for QgsTextFormatWidget.
QListWidgetItem * mFormattingItem
Formatting widget item.
void deactivateField(QgsPalLayerSettings::Property key)
Deactivate a field from data defined properties and update the corresponding button.
void setFormat(const QgsTextFormat &format)
Sets the current formatting settings.
QListWidgetItem * mTextItem
Text widget item.
Qgis::GeometryType mGeomType
Geometry type for layer, if known.
QButtonGroup * mDirectSymbBtnGrp
Symbol direction button group.
QList< QgsSymbolLayerReference > mMaskedSymbolLayers
void widgetChanged()
Emitted when the text format defined by the widget changes.
Q_DECL_DEPRECATED void enableDataDefinedAlignment(bool enable)
Update the enabled state of the data defined alignment buttons.
QButtonGroup * mQuadrantBtnGrp
Quadrant button group.
QListWidgetItem * mShadowItem
Shadow widget item.
QList< QgsTextFormat::Tab > mTabPositions
Tab positions.
QgsSymbolWidgetContext mContext
Context in which widget is shown.
QListWidgetItem * mBufferItem
Buffer widget item.
void updateLinePlacementOptions()
Updates line placement options to reflect current state of widget.
QListWidgetItem * mCalloutItem
Callout widget item.
void populateDataDefinedButtons()
Sets up connections required for data defined buttons, or updates the existing definition of these bu...
virtual void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the widget is shown, e.g., the associated map canvas and expression context...
QListWidgetItem * mRenderingItem
Rendering widget item.
void updatePreview()
Updates the text preview.
QListWidgetItem * mPlacementItem
Placement widget item.
void auxiliaryFieldCreated()
Emitted when an auxiliary field is created in the widget.
virtual void setFormatFromStyle(const QString &name, QgsStyle::StyleEntity type, const QString &stylePath)
Sets the current text settings from a style entry.
QgsMapLayer * mLayer
Associated vector layer.
QgsStringReplacementCollection mSubstitutions
Text substitution list.
@ Text
Default mode, show text formatting settings only.
@ Labeling
Show labeling settings in addition to text formatting settings.
virtual void saveFormat()
Saves the current text settings to a style entry.
QgsPropertyCollection mDataDefinedProperties
Data defined properties as defined in the widget.
Container for all settings relating to text rendering.