18 #include <QColorDialog> 25 connect( mArrowWidthSpin, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mArrowWidthSpin_valueChanged );
27 connect( mArrowStartWidthSpin, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mArrowStartWidthSpin_valueChanged );
29 connect( mHeadLengthSpin, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mHeadLengthSpin_valueChanged );
31 connect( mHeadThicknessSpin, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mHeadThicknessSpin_valueChanged );
33 connect( mHeadTypeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsArrowSymbolLayerWidget::mHeadTypeCombo_currentIndexChanged );
34 connect( mArrowTypeCombo,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsArrowSymbolLayerWidget::mArrowTypeCombo_currentIndexChanged );
35 connect( mOffsetSpin, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsArrowSymbolLayerWidget::mOffsetSpin_valueChanged );
37 connect( mCurvedArrowChck, &QCheckBox::stateChanged,
this, &QgsArrowSymbolLayerWidget::mCurvedArrowChck_stateChanged );
38 connect( mRepeatArrowChck, &QCheckBox::stateChanged,
this, &QgsArrowSymbolLayerWidget::mRepeatArrowChck_stateChanged );
39 this->layout()->setContentsMargins( 0, 0, 0, 0 );
52 mOffsetSpin->setClearValue( 0.0 );
57 if ( !layer || layer->
layerType() != QLatin1String(
"ArrowLine" ) )
64 mArrowWidthSpin->setValue( mLayer->
arrowWidth() );
72 mHeadLengthSpin->setValue( mLayer->
headLength() );
79 mHeadTypeCombo->setCurrentIndex( mLayer->
headType() );
80 mArrowTypeCombo->setCurrentIndex( mLayer->
arrowType() );
82 mOffsetSpin->setValue( mLayer->
offset() );
83 mOffsetUnitWidget->setUnit( mLayer->
offsetUnit() );
86 mCurvedArrowChck->setChecked( mLayer->
isCurved() );
87 mRepeatArrowChck->setChecked( mLayer->
isRepeated() );
104 void QgsArrowSymbolLayerWidget::mArrowWidthSpin_valueChanged(
double d )
113 void QgsArrowSymbolLayerWidget::mArrowStartWidthSpin_valueChanged(
double d )
122 void QgsArrowSymbolLayerWidget::mHeadLengthSpin_valueChanged(
double d )
131 void QgsArrowSymbolLayerWidget::mHeadThicknessSpin_valueChanged(
double d )
140 void QgsArrowSymbolLayerWidget::mArrowWidthUnitWidget_changed()
150 void QgsArrowSymbolLayerWidget::mArrowStartWidthUnitWidget_changed()
160 void QgsArrowSymbolLayerWidget::mHeadLengthUnitWidget_changed()
170 void QgsArrowSymbolLayerWidget::mHeadThicknessUnitWidget_changed()
180 void QgsArrowSymbolLayerWidget::mHeadTypeCombo_currentIndexChanged(
int idx )
188 mArrowStartWidthDDBtn->setEnabled( isSingle );
189 mArrowStartWidthSpin->setEnabled( isSingle );
190 mArrowStartWidthUnitWidget->setEnabled( isSingle );
194 void QgsArrowSymbolLayerWidget::mArrowTypeCombo_currentIndexChanged(
int idx )
204 void QgsArrowSymbolLayerWidget::mOffsetSpin_valueChanged(
double d )
213 void QgsArrowSymbolLayerWidget::mOffsetUnitWidget_changed()
223 void QgsArrowSymbolLayerWidget::mCurvedArrowChck_stateChanged(
int state )
232 void QgsArrowSymbolLayerWidget::mRepeatArrowChck_stateChanged(
int state )
double arrowWidth() const
Gets current arrow width.
void setHeadThicknessUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the head height.
void setHeadLengthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the head length.
ArrowType arrowType() const
Gets the current arrow type.
void setMapUnitScale(const QgsMapUnitScale &scale) override
double arrowStartWidth() const
Gets current arrow start width. Only meaningful for single headed arrows.
void setArrowWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the arrow width.
QgsMapUnitScale arrowWidthUnitScale() const
Gets the scale for the arrow width.
QgsUnitTypes::RenderUnit headLengthUnit() const
Gets the unit for the head length.
void setHeadThicknessUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the head height.
QgsUnitTypes::RenderUnit arrowStartWidthUnit() const
Gets the unit for the arrow start width.
QList< QgsUnitTypes::RenderUnit > RenderUnitList
List of render units.
double headLength() const
Gets the current arrow head length.
const QgsMapUnitScale & offsetMapUnitScale() const
void setHeadLength(double length)
Sets the arrow head length.
void setHeadThickness(double thickness)
Sets the arrow head height.
points (e.g., for font sizes)
void setArrowWidth(double width)
Sets the arrow width.
ArrowType
Possible arrow types.
void setIsRepeated(bool isRepeated)
Sets whether the arrow is repeated along the line.
HeadType headType() const
Gets the current head type.
QgsMapUnitScale headThicknessUnitScale() const
Gets the scale for the head height.
QgsUnitTypes::RenderUnit arrowWidthUnit() const
Gets the unit for the arrow width.
bool isCurved() const
Returns whether it is a curved arrow or a straight one.
void setIsCurved(bool isCurved)
Sets whether it is a curved arrow or a straight one.
QgsUnitTypes::RenderUnit headThicknessUnit() const
Gets the unit for the head height.
void setHeadLengthUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the head length.
void setArrowType(ArrowType type)
Sets the arrow type.
void setArrowWidthUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the arrow width.
void setHeadType(HeadType type)
Sets the head type.
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's offset.
bool isRepeated() const
Returns whether the arrow is repeated along the line or not.
QgsUnitTypes::RenderUnit offsetUnit() const
Returns the units for the line's offset.
Line symbol layer used for representing lines as arrows.
HeadType
Possible head types.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setArrowStartWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the unit for the arrow start width.
QgsMapUnitScale headLengthUnitScale() const
Gets the scale for the head length.
Represents a vector layer which manages a vector based data sets.
QgsMapUnitScale arrowStartWidthUnitScale() const
Gets the scale for the arrow start width.
void setArrowStartWidth(double width)
Sets the arrow start width.
void setArrowStartWidthUnitScale(const QgsMapUnitScale &scale)
Sets the scale for the arrow start width.
void setOffset(double offset)
virtual QString layerType() const =0
Returns a string that represents this layer type.
double headThickness() const
Gets the current arrow head height.