16#include "moc_qgsvectorfieldsymbollayerwidget.cpp"
24 connect( mScaleSpinBox,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &QgsVectorFieldSymbolLayerWidget::mScaleSpinBox_valueChanged );
25 connect( mXAttributeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsVectorFieldSymbolLayerWidget::mXAttributeComboBox_currentIndexChanged );
26 connect( mYAttributeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsVectorFieldSymbolLayerWidget::mYAttributeComboBox_currentIndexChanged );
27 connect( mCartesianRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mCartesianRadioButton_toggled );
28 connect( mPolarRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mPolarRadioButton_toggled );
29 connect( mHeightRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mHeightRadioButton_toggled );
30 connect( mDegreesRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mDegreesRadioButton_toggled );
31 connect( mRadiansRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mRadiansRadioButton_toggled );
32 connect( mClockwiseFromNorthRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mClockwiseFromNorthRadioButton_toggled );
33 connect( mCounterclockwiseFromEastRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mCounterclockwiseFromEastRadioButton_toggled );
40 mXAttributeComboBox->addItem( QString() );
41 mYAttributeComboBox->addItem( QString() );
43 const QgsFields fields = lVectorLayer->fields();
46 const QString fieldName = f.name();
47 mXAttributeComboBox->addItem( lVectorLayer->fields().iconForField( i ), fieldName );
48 mYAttributeComboBox->addItem( lVectorLayer->fields().iconForField( i ), fieldName );
56 if ( layer->
layerType() != QLatin1String(
"VectorField" ) )
66 mXAttributeComboBox->setCurrentIndex( mXAttributeComboBox->findText(
mLayer->
xAttribute() ) );
67 mYAttributeComboBox->setCurrentIndex( mYAttributeComboBox->findText(
mLayer->
yAttribute() ) );
73 mCartesianRadioButton->setChecked(
true );
77 mPolarRadioButton->setChecked(
true );
81 mHeightRadioButton->setChecked(
true );
87 mClockwiseFromNorthRadioButton->setChecked(
true );
91 mCounterclockwiseFromEastRadioButton->setChecked(
true );
97 mDegreesRadioButton->setChecked(
true );
101 mRadiansRadioButton->setChecked(
true );
104 mDistanceUnitWidget->blockSignals(
true );
107 mDistanceUnitWidget->blockSignals(
false );
117void QgsVectorFieldSymbolLayerWidget::mScaleSpinBox_valueChanged(
double d )
126void QgsVectorFieldSymbolLayerWidget::mXAttributeComboBox_currentIndexChanged(
int index )
135void QgsVectorFieldSymbolLayerWidget::mYAttributeComboBox_currentIndexChanged(
int index )
144void QgsVectorFieldSymbolLayerWidget::mCartesianRadioButton_toggled(
bool checked )
149 mXAttributeComboBox->setEnabled(
true );
150 mYAttributeComboBox->setEnabled(
true );
151 mXAttributeLabel->setText( tr(
"X attribute" ) );
152 mYAttributeLabel->setText( tr(
"Y attribute" ) );
157void QgsVectorFieldSymbolLayerWidget::mPolarRadioButton_toggled(
bool checked )
162 mXAttributeComboBox->setEnabled(
true );
163 mYAttributeComboBox->setEnabled(
true );
164 mXAttributeLabel->setText( tr(
"Length attribute" ) );
165 mYAttributeLabel->setText( tr(
"Angle attribute" ) );
170void QgsVectorFieldSymbolLayerWidget::mHeightRadioButton_toggled(
bool checked )
175 mXAttributeLabel->clear();
176 mXAttributeComboBox->setEnabled(
false );
177 mYAttributeLabel->setText( tr(
"Height attribute" ) );
182void QgsVectorFieldSymbolLayerWidget::mDegreesRadioButton_toggled(
bool checked )
191void QgsVectorFieldSymbolLayerWidget::mRadiansRadioButton_toggled(
bool checked )
200void QgsVectorFieldSymbolLayerWidget::mClockwiseFromNorthRadioButton_toggled(
bool checked )
209void QgsVectorFieldSymbolLayerWidget::mCounterclockwiseFromEastRadioButton_toggled(
bool checked )
218void QgsVectorFieldSymbolLayerWidget::mDistanceUnitWidget_changed()
@ Millimeters
Millimeters.
@ Points
Points (e.g., for font sizes)
Encapsulate a field in an attribute table or data source.
Container of fields for a vector layer.
Abstract base class for symbol layers.
virtual QString layerType() const =0
Returns a string that represents this layer type.
QList< Qgis::RenderUnit > RenderUnitList
List of render units.
A symbol layer class for displaying displacement arrows based on point layer attributes.
const QgsMapUnitScale & distanceMapUnitScale() const
void setYAttribute(const QString &attribute)
void setAngleUnits(AngleUnits units)
void setVectorFieldType(VectorFieldType type)
QString yAttribute() const
void setDistanceUnit(Qgis::RenderUnit unit)
Sets the units for the distance.
AngleUnits angleUnits() const
void setAngleOrientation(AngleOrientation orientation)
AngleOrientation angleOrientation() const
void setXAttribute(const QString &attribute)
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
QString xAttribute() const
Qgis::RenderUnit distanceUnit() const
Returns the units for the distance.
@ CounterclockwiseFromEast
VectorFieldType vectorFieldType() const
Represents a vector layer which manages a vector based dataset.