20 #include <QColorDialog> 33 btnChangeColorFill->setAllowAlpha(
true );
34 btnChangeColorFill->setColorDialogTitle(
tr(
"Select fill color" ) );
35 btnChangeColorFill->setContext(
"symbology" );
36 btnChangeColorFill->setShowNoColor(
true );
37 btnChangeColorFill->setNoColorString(
tr(
"Transparent fill" ) );
38 btnChangeColorBorder->setAllowAlpha(
true );
39 btnChangeColorBorder->setColorDialogTitle(
tr(
"Select border color" ) );
40 btnChangeColorBorder->setContext(
"symbology" );
41 btnChangeColorBorder->setShowNoColor(
true );
42 btnChangeColorBorder->setNoColorString(
tr(
"Transparent border" ) );
44 spinOffsetX->setClearValue( 0.0 );
45 spinOffsetY->setClearValue( 0.0 );
46 mRotationSpinBox->setClearValue( 0.0 );
49 names <<
"circle" <<
"rectangle" <<
"diamond" <<
"cross" <<
"triangle" <<
"right_half_triangle" <<
"left_half_triangle" <<
"semi_circle";
50 QSize iconSize = mShapeListWidget->iconSize();
63 item->
setData( Qt::UserRole, name );
67 connect( spinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT( setOffset() ) );
68 connect( spinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT( setOffset() ) );
69 connect( cboJoinStyle, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT( penJoinStyleChanged() ) );
74 if ( !layer || layer->
layerType() !=
"EllipseMarker" )
89 if ( !symbolItemList.
isEmpty() )
91 mShapeListWidget->setCurrentItem( symbolItemList.
at( 0 ) );
95 blockComboSignals(
true );
105 spinOffsetX->setValue( offsetPt.
x() );
106 spinOffsetY->setValue( offsetPt.
y() );
110 blockComboSignals(
false );
132 void QgsEllipseSymbolLayerV2Widget::on_mShapeListWidget_itemSelectionChanged()
145 void QgsEllipseSymbolLayerV2Widget::on_mWidthSpinBox_valueChanged(
double d )
154 void QgsEllipseSymbolLayerV2Widget::on_mHeightSpinBox_valueChanged(
double d )
163 void QgsEllipseSymbolLayerV2Widget::on_mRotationSpinBox_valueChanged(
double d )
172 void QgsEllipseSymbolLayerV2Widget::on_mOutlineStyleComboBox_currentIndexChanged(
int index )
183 void QgsEllipseSymbolLayerV2Widget::on_mOutlineWidthSpinBox_valueChanged(
double d )
192 void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorBorder_colorChanged(
const QColor& newColor )
203 void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorFill_colorChanged(
const QColor& newColor )
214 void QgsEllipseSymbolLayerV2Widget::on_mSymbolWidthUnitWidget_changed()
224 void QgsEllipseSymbolLayerV2Widget::on_mOutlineWidthUnitWidget_changed()
234 void QgsEllipseSymbolLayerV2Widget::on_mSymbolHeightUnitWidget_changed()
244 void QgsEllipseSymbolLayerV2Widget::on_mOffsetUnitWidget_changed()
254 void QgsEllipseSymbolLayerV2Widget::penJoinStyleChanged()
260 void QgsEllipseSymbolLayerV2Widget::blockComboSignals(
bool block )
262 mSymbolWidthUnitWidget->blockSignals( block );
263 mOutlineWidthUnitWidget->blockSignals( block );
264 mSymbolHeightUnitWidget->blockSignals( block );
265 mHorizontalAnchorComboBox->blockSignals( block );
266 mVerticalAnchorComboBox->blockSignals( block );
267 mSymbolWidthUnitWidget->blockSignals( block );
268 mOutlineWidthUnitWidget->blockSignals( block );
269 mSymbolHeightUnitWidget->blockSignals( block );
270 mOffsetUnitWidget->blockSignals( block );
271 cboJoinStyle->blockSignals( block );
274 void QgsEllipseSymbolLayerV2Widget::on_mHorizontalAnchorComboBox_currentIndexChanged(
int index )
283 void QgsEllipseSymbolLayerV2Widget::on_mVerticalAnchorComboBox_currentIndexChanged(
int index )
292 void QgsEllipseSymbolLayerV2Widget::setOffset()
void setSymbolHeight(double h)
void setSymbolWidthUnit(QgsSymbolV2::OutputUnit unit)
QColor fillColor() const override
Get fill color.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
static QIcon symbolLayerPreviewIcon(QgsSymbolLayerV2 *layer, QgsSymbolV2::OutputUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
void setSymbolWidth(double w)
The output shall be in pixels.
const T & at(int i) const
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
const QgsMapUnitScale & symbolHeightMapUnitScale() const
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
const QgsMapUnitScale & symbolWidthMapUnitScale() const
QColor outlineColor() const override
Get outline color.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset.
A symbol layer for rendering objects with major and minor axis (e.g.
QString tr(const char *sourceText, const char *disambiguation, int n)
double symbolHeight() const
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
Sets the units for the symbol's offset.
const char * name() const
void setSymbolHeightMapUnitScale(const QgsMapUnitScale &scale)
The output shall be in millimeters.
QgsSymbolV2::OutputUnit symbolWidthUnit() const
QgsSymbolV2::OutputUnit outlineWidthUnit() const
double outlineWidth() const
The output shall be in map unitx.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
Qt::PenStyle outlineStyle() const
void setOutlineStyle(Qt::PenStyle outlineStyle)
void setSymbolName(const QString &name)
QgsSymbolV2::OutputUnit offsetUnit() const
Returns the units for the symbol's offset.
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the symbol's offset.
QString symbolName() const
virtual QString layerType() const =0
Returns a string that represents this layer type.
VerticalAnchorPoint
Symbol vertical anchor points.
QgsSymbolV2::OutputUnit symbolHeightUnit() const
void setSymbolWidthMapUnitScale(const QgsMapUnitScale &scale)
double symbolWidth() const
Qt::PenJoinStyle penJoinStyle() const
Get outline join style.
void setOutlineColor(const QColor &c) override
Set outline color.
const QgsMapUnitScale & outlineWidthMapUnitScale() const
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
virtual void setColor(const QColor &color)
The fill color.
HorizontalAnchorPoint
Symbol horizontal anchor points.
void setPenJoinStyle(Qt::PenJoinStyle style)
Set outline join style.
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setAngle(double angle)
Sets the rotation angle for the marker.
Represents a vector layer which manages a vector based data sets.
void setFillColor(const QColor &c) override
Set fill color.
void setSymbolHeightUnit(QgsSymbolV2::OutputUnit unit)
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
void setOutlineWidth(double w)