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 );
34 mDistanceUnitWidget->setUnits(
QgsUnitTypes::RenderUnitList() << Qgis::RenderUnit::Millimeters << Qgis::RenderUnit::MapUnits << Qgis::RenderUnit::Pixels
35 << Qgis::RenderUnit::Points << Qgis::RenderUnit::Inches );
39 mXAttributeComboBox->addItem( QString() );
40 mYAttributeComboBox->addItem( QString() );
42 const QgsFields fields = lVectorLayer->fields();
45 const QString fieldName = f.name();
46 mXAttributeComboBox->addItem( lVectorLayer->fields().iconForField( i ), fieldName );
47 mYAttributeComboBox->addItem( lVectorLayer->fields().iconForField( i ), fieldName );
55 if ( layer->
layerType() != QLatin1String(
"VectorField" ) )
65 mXAttributeComboBox->setCurrentIndex( mXAttributeComboBox->findText(
mLayer->
xAttribute() ) );
66 mYAttributeComboBox->setCurrentIndex( mYAttributeComboBox->findText(
mLayer->
yAttribute() ) );
72 mCartesianRadioButton->setChecked(
true );
76 mPolarRadioButton->setChecked(
true );
80 mHeightRadioButton->setChecked(
true );
86 mClockwiseFromNorthRadioButton->setChecked(
true );
90 mCounterclockwiseFromEastRadioButton->setChecked(
true );
96 mDegreesRadioButton->setChecked(
true );
100 mRadiansRadioButton->setChecked(
true );
103 mDistanceUnitWidget->blockSignals(
true );
106 mDistanceUnitWidget->blockSignals(
false );
116void QgsVectorFieldSymbolLayerWidget::mScaleSpinBox_valueChanged(
double d )
125void QgsVectorFieldSymbolLayerWidget::mXAttributeComboBox_currentIndexChanged(
int index )
134void QgsVectorFieldSymbolLayerWidget::mYAttributeComboBox_currentIndexChanged(
int index )
143void QgsVectorFieldSymbolLayerWidget::mCartesianRadioButton_toggled(
bool checked )
148 mXAttributeComboBox->setEnabled(
true );
149 mYAttributeComboBox->setEnabled(
true );
150 mXAttributeLabel->setText( tr(
"X attribute" ) );
151 mYAttributeLabel->setText( tr(
"Y attribute" ) );
156void QgsVectorFieldSymbolLayerWidget::mPolarRadioButton_toggled(
bool checked )
161 mXAttributeComboBox->setEnabled(
true );
162 mYAttributeComboBox->setEnabled(
true );
163 mXAttributeLabel->setText( tr(
"Length attribute" ) );
164 mYAttributeLabel->setText( tr(
"Angle attribute" ) );
169void QgsVectorFieldSymbolLayerWidget::mHeightRadioButton_toggled(
bool checked )
174 mXAttributeLabel->clear();
175 mXAttributeComboBox->setEnabled(
false );
176 mYAttributeLabel->setText( tr(
"Height attribute" ) );
181void QgsVectorFieldSymbolLayerWidget::mDegreesRadioButton_toggled(
bool checked )
190void QgsVectorFieldSymbolLayerWidget::mRadiansRadioButton_toggled(
bool checked )
199void QgsVectorFieldSymbolLayerWidget::mClockwiseFromNorthRadioButton_toggled(
bool checked )
208void QgsVectorFieldSymbolLayerWidget::mCounterclockwiseFromEastRadioButton_toggled(
bool checked )
217void QgsVectorFieldSymbolLayerWidget::mDistanceUnitWidget_changed()
Encapsulate a field in an attribute table or data source.
Container of fields for a vector layer.
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 data sets.