16#include "moc_qgsarrowsymbollayerwidget.cpp"
19#include <QColorDialog>
26 connect( mArrowWidthSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mArrowWidthSpin_valueChanged );
28 connect( mArrowStartWidthSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mArrowStartWidthSpin_valueChanged );
30 connect( mHeadLengthSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mHeadLengthSpin_valueChanged );
32 connect( mHeadThicknessSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mHeadThicknessSpin_valueChanged );
34 connect( mHeadTypeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsArrowSymbolLayerWidget::mHeadTypeCombo_currentIndexChanged );
35 connect( mArrowTypeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsArrowSymbolLayerWidget::mArrowTypeCombo_currentIndexChanged );
36 connect( mOffsetSpin,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mOffsetSpin_valueChanged );
38 connect( mCurvedArrowChck, &QCheckBox::stateChanged,
this, &QgsArrowSymbolLayerWidget::mCurvedArrowChck_stateChanged );
39 connect( mRepeatArrowChck, &QCheckBox::stateChanged,
this, &QgsArrowSymbolLayerWidget::mRepeatArrowChck_stateChanged );
40 this->layout()->setContentsMargins( 0, 0, 0, 0 );
48 mOffsetSpin->setClearValue( 0.0 );
53 if ( !layer || layer->
layerType() != QLatin1String(
"ArrowLine" ) )
60 mArrowWidthSpin->setValue( mLayer->
arrowWidth() );
68 mHeadLengthSpin->setValue( mLayer->
headLength() );
75 mHeadTypeCombo->setCurrentIndex( mLayer->
headType() );
76 mArrowTypeCombo->setCurrentIndex( mLayer->
arrowType() );
78 mOffsetSpin->setValue( mLayer->
offset() );
79 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
82 mCurvedArrowChck->setChecked( mLayer->
isCurved() );
83 mRepeatArrowChck->setChecked( mLayer->
isRepeated() );
100void QgsArrowSymbolLayerWidget::mArrowWidthSpin_valueChanged(
double d )
109void QgsArrowSymbolLayerWidget::mArrowStartWidthSpin_valueChanged(
double d )
118void QgsArrowSymbolLayerWidget::mHeadLengthSpin_valueChanged(
double d )
127void QgsArrowSymbolLayerWidget::mHeadThicknessSpin_valueChanged(
double d )
136void QgsArrowSymbolLayerWidget::mArrowWidthUnitWidget_changed()
146void QgsArrowSymbolLayerWidget::mArrowStartWidthUnitWidget_changed()
156void QgsArrowSymbolLayerWidget::mHeadLengthUnitWidget_changed()
166void QgsArrowSymbolLayerWidget::mHeadThicknessUnitWidget_changed()
176void QgsArrowSymbolLayerWidget::mHeadTypeCombo_currentIndexChanged(
int idx )
184 mArrowStartWidthDDBtn->setEnabled( isSingle );
185 mArrowStartWidthSpin->setEnabled( isSingle );
186 mArrowStartWidthUnitWidget->setEnabled( isSingle );
190void QgsArrowSymbolLayerWidget::mArrowTypeCombo_currentIndexChanged(
int idx )
200void QgsArrowSymbolLayerWidget::mOffsetSpin_valueChanged(
double d )
209void QgsArrowSymbolLayerWidget::mOffsetUnitWidget_changed()
219void QgsArrowSymbolLayerWidget::mCurvedArrowChck_stateChanged(
int state )
228void QgsArrowSymbolLayerWidget::mRepeatArrowChck_stateChanged(
int state )
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
Line symbol layer used for representing lines as arrows.
bool isCurved() const
Returns whether it is a curved arrow or a straight one.
ArrowType arrowType() const
Gets the current arrow type.
HeadType
Possible head types.
HeadType headType() const
Gets the current head type.
void setArrowStartWidth(double width)
Sets the arrow start width.
bool isRepeated() const
Returns whether the arrow is repeated along the line or not.
void setArrowWidth(double width)
Sets the arrow width.
void setArrowType(ArrowType type)
Sets the arrow type.
void setHeadLengthUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the head length.
QgsMapUnitScale headThicknessUnitScale() const
Gets the scale for the head height.
Qgis::RenderUnit arrowWidthUnit() const
Gets the unit for the arrow width.
Qgis::RenderUnit headLengthUnit() const
Gets the unit for the head length.
Qgis::RenderUnit headThicknessUnit() const
Gets the unit for the head height.
void setArrowWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the arrow width.
void setIsCurved(bool isCurved)
Sets whether it is a curved arrow or a straight one.
void setHeadThickness(double thickness)
Sets the arrow head height.
void setHeadLengthUnit(Qgis::RenderUnit unit)
Sets the unit for the head length.
void setIsRepeated(bool isRepeated)
Sets whether the arrow is repeated along the line.
double arrowStartWidth() const
Gets current arrow start width. Only meaningful for single headed arrows.
void setArrowStartWidthUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the arrow start width.
void setHeadThicknessUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the head height.
void setHeadType(HeadType type)
Sets the head type.
QgsMapUnitScale arrowStartWidthUnitScale() const
Gets the scale for the arrow start width.
double headThickness() const
Gets the current arrow head height.
void setArrowWidthUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the arrow width.
ArrowType
Possible arrow types.
double arrowWidth() const
Gets current arrow width.
QgsMapUnitScale arrowWidthUnitScale() const
Gets the scale for the arrow width.
void setArrowStartWidthUnit(Qgis::RenderUnit unit)
Sets the unit for the arrow start width.
Qgis::RenderUnit arrowStartWidthUnit() const
Gets the unit for the arrow start width.
QgsMapUnitScale headLengthUnitScale() const
Gets the scale for the head length.
void setHeadLength(double length)
Sets the arrow head length.
double headLength() const
Gets the current arrow head length.
void setHeadThicknessUnit(Qgis::RenderUnit unit)
Sets the unit for the head height.
void setOffset(double offset)
Sets the line's offset.
void setOffsetUnit(Qgis::RenderUnit unit)
Sets the unit for the line's offset.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the line's offset.
void setMapUnitScale(const QgsMapUnitScale &scale) override
double offset() const
Returns the line's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the line's offset.
Qgis::RenderUnit offsetUnit() const
Returns the units for the line's offset.
@ ArrowHeadLength
Arrow head length.
@ ArrowWidth
Arrow tail width.
@ ArrowHeadType
Arrow head type.
@ ArrowHeadThickness
Arrow head thickness.
@ ArrowStartWidth
Arrow tail start width.
virtual QString layerType() const =0
Returns a string that represents this layer type.
Represents a vector layer which manages a vector based data sets.