20 #include <QColorDialog>
28 mSymbolWidthUnitWidget->setUnits( QStringList() <<
tr(
"Millimeter" ) <<
tr(
"Map unit" ), 1 );
29 mSymbolHeightUnitWidget->setUnits( QStringList() <<
tr(
"Millimeter" ) <<
tr(
"Map unit" ), 1 );
30 mOutlineWidthUnitWidget->setUnits( QStringList() <<
tr(
"Millimeter" ) <<
tr(
"Map unit" ), 1 );
31 mOffsetUnitWidget->setUnits( QStringList() <<
tr(
"Millimeter" ) <<
tr(
"Map unit" ), 1 );
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" <<
"cross" <<
"triangle";
50 QSize iconSize = mShapeListWidget->iconSize();
52 QStringList::const_iterator nameIt = names.constBegin();
53 for ( ; nameIt != names.constEnd(); ++nameIt )
62 QListWidgetItem* item =
new QListWidgetItem( icon,
"", mShapeListWidget );
63 item->setToolTip( *nameIt );
64 item->setData( Qt::UserRole, *nameIt );
68 connect( spinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT( setOffset() ) );
69 connect( spinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT( setOffset() ) );
74 if ( !layer || layer->
layerType() !=
"EllipseMarker" )
88 QList<QListWidgetItem *> symbolItemList = mShapeListWidget->findItems(
mLayer->
symbolName(), Qt::MatchExactly );
89 if ( symbolItemList.size() > 0 )
91 mShapeListWidget->setCurrentItem( symbolItemList.at( 0 ) );
95 blockComboSignals(
true );
105 spinOffsetX->setValue( offsetPt.x() );
106 spinOffsetY->setValue( offsetPt.y() );
109 blockComboSignals(
false );
130 void QgsEllipseSymbolLayerV2Widget::on_mShapeListWidget_itemSelectionChanged()
134 QListWidgetItem* item = mShapeListWidget->currentItem();
143 void QgsEllipseSymbolLayerV2Widget::on_mWidthSpinBox_valueChanged(
double d )
152 void QgsEllipseSymbolLayerV2Widget::on_mHeightSpinBox_valueChanged(
double d )
161 void QgsEllipseSymbolLayerV2Widget::on_mRotationSpinBox_valueChanged(
double d )
170 void QgsEllipseSymbolLayerV2Widget::on_mOutlineStyleComboBox_currentIndexChanged(
int index )
181 void QgsEllipseSymbolLayerV2Widget::on_mOutlineWidthSpinBox_valueChanged(
double d )
190 void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorBorder_colorChanged(
const QColor& newColor )
201 void QgsEllipseSymbolLayerV2Widget::on_btnChangeColorFill_colorChanged(
const QColor& newColor )
212 void QgsEllipseSymbolLayerV2Widget::on_mSymbolWidthUnitWidget_changed()
223 void QgsEllipseSymbolLayerV2Widget::on_mOutlineWidthUnitWidget_changed()
234 void QgsEllipseSymbolLayerV2Widget::on_mSymbolHeightUnitWidget_changed()
245 void QgsEllipseSymbolLayerV2Widget::on_mOffsetUnitWidget_changed()
256 void QgsEllipseSymbolLayerV2Widget::blockComboSignals(
bool block )
258 mSymbolWidthUnitWidget->blockSignals( block );
259 mOutlineWidthUnitWidget->blockSignals( block );
260 mSymbolHeightUnitWidget->blockSignals( block );
261 mHorizontalAnchorComboBox->blockSignals( block );
262 mVerticalAnchorComboBox->blockSignals( block );
263 mSymbolWidthUnitWidget->blockSignals( block );
264 mOutlineWidthUnitWidget->blockSignals( block );
265 mSymbolHeightUnitWidget->blockSignals( block );
266 mOffsetUnitWidget->blockSignals( block );
269 void QgsEllipseSymbolLayerV2Widget::on_mHorizontalAnchorComboBox_currentIndexChanged(
int index )
278 void QgsEllipseSymbolLayerV2Widget::on_mVerticalAnchorComboBox_currentIndexChanged(
int index )
287 void QgsEllipseSymbolLayerV2Widget::setOffset()
289 mLayer->
setOffset( QPointF( spinOffsetX->value(), spinOffsetY->value() ) );