22 connect( mScaleSpinBox, static_cast <
void ( QDoubleSpinBox::* )(
double ) > ( &QDoubleSpinBox::valueChanged ),
this, &QgsVectorFieldSymbolLayerWidget::mScaleSpinBox_valueChanged );
23 connect( mXAttributeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsVectorFieldSymbolLayerWidget::mXAttributeComboBox_currentIndexChanged );
24 connect( mYAttributeComboBox,
static_cast<void ( QComboBox::* )(
int )
>( &QComboBox::currentIndexChanged ),
this, &QgsVectorFieldSymbolLayerWidget::mYAttributeComboBox_currentIndexChanged );
25 connect( mCartesianRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mCartesianRadioButton_toggled );
26 connect( mPolarRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mPolarRadioButton_toggled );
27 connect( mHeightRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mHeightRadioButton_toggled );
28 connect( mDegreesRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mDegreesRadioButton_toggled );
29 connect( mRadiansRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mRadiansRadioButton_toggled );
30 connect( mClockwiseFromNorthRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mClockwiseFromNorthRadioButton_toggled );
31 connect( mCounterclockwiseFromEastRadioButton, &QRadioButton::toggled,
this, &QgsVectorFieldSymbolLayerWidget::mCounterclockwiseFromEastRadioButton_toggled );
39 mXAttributeComboBox->addItem( QLatin1String(
"" ) );
40 mYAttributeComboBox->addItem( QLatin1String(
"" ) );
44 QString fieldName = f.
name();
45 mXAttributeComboBox->addItem(
vectorLayer()->fields().iconForField( i ), fieldName );
46 mYAttributeComboBox->addItem(
vectorLayer()->fields().iconForField( i ), fieldName );
54 if ( layer->
layerType() != QLatin1String(
"VectorField" ) )
64 mXAttributeComboBox->setCurrentIndex( mXAttributeComboBox->findText(
mLayer->
xAttribute() ) );
65 mYAttributeComboBox->setCurrentIndex( mYAttributeComboBox->findText(
mLayer->
yAttribute() ) );
71 mCartesianRadioButton->setChecked(
true );
75 mPolarRadioButton->setChecked(
true );
79 mHeightRadioButton->setChecked(
true );
85 mClockwiseFromNorthRadioButton->setChecked(
true );
89 mCounterclockwiseFromEastRadioButton->setChecked(
true );
95 mDegreesRadioButton->setChecked(
true );
99 mRadiansRadioButton->setChecked(
true );
102 mDistanceUnitWidget->blockSignals(
true );
105 mDistanceUnitWidget->blockSignals(
false );
115 void QgsVectorFieldSymbolLayerWidget::mScaleSpinBox_valueChanged(
double d )
124 void QgsVectorFieldSymbolLayerWidget::mXAttributeComboBox_currentIndexChanged(
int index )
133 void QgsVectorFieldSymbolLayerWidget::mYAttributeComboBox_currentIndexChanged(
int index )
142 void QgsVectorFieldSymbolLayerWidget::mCartesianRadioButton_toggled(
bool checked )
147 mXAttributeComboBox->setEnabled(
true );
148 mYAttributeComboBox->setEnabled(
true );
149 mXAttributeLabel->setText( tr(
"X attribute" ) );
150 mYAttributeLabel->setText( tr(
"Y attribute" ) );
155 void QgsVectorFieldSymbolLayerWidget::mPolarRadioButton_toggled(
bool checked )
160 mXAttributeComboBox->setEnabled(
true );
161 mYAttributeComboBox->setEnabled(
true );
162 mXAttributeLabel->setText( tr(
"Length attribute" ) );
163 mYAttributeLabel->setText( tr(
"Angle attribute" ) );
168 void QgsVectorFieldSymbolLayerWidget::mHeightRadioButton_toggled(
bool checked )
173 mXAttributeLabel->clear();
174 mXAttributeComboBox->setEnabled(
false );
175 mYAttributeLabel->setText( tr(
"Height attribute" ) );
180 void QgsVectorFieldSymbolLayerWidget::mDegreesRadioButton_toggled(
bool checked )
189 void QgsVectorFieldSymbolLayerWidget::mRadiansRadioButton_toggled(
bool checked )
198 void QgsVectorFieldSymbolLayerWidget::mClockwiseFromNorthRadioButton_toggled(
bool checked )
207 void QgsVectorFieldSymbolLayerWidget::mCounterclockwiseFromEastRadioButton_toggled(
bool checked )
216 void QgsVectorFieldSymbolLayerWidget::mDistanceUnitWidget_changed()
void setXAttribute(const QString &attribute)
void setYAttribute(const QString &attribute)
void setAngleUnits(AngleUnits units)
void setDistanceUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the distance.
AngleOrientation angleOrientation() const
QString yAttribute() const
QList< QgsUnitTypes::RenderUnit > RenderUnitList
List of render units.
A symbol layer class for displaying displacement arrows based on point layer attributes.
const QgsMapUnitScale & distanceMapUnitScale() const
points (e.g., for font sizes)
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
Encapsulate a field in an attribute table or data source.
QgsUnitTypes::RenderUnit distanceUnit() const
Returns the units for the distance.
AngleUnits angleUnits() const
QString xAttribute() const
void setAngleOrientation(AngleOrientation orientation)
Represents a vector layer which manages a vector based data sets.
VectorFieldType vectorFieldType() const
void setVectorFieldType(VectorFieldType type)
virtual QString layerType() const =0
Returns a string that represents this layer type.