39 #include <QAbstractButton>
40 #include <QColorDialog>
43 #include <QFileDialog>
46 #include <QStandardItemModel>
47 #include <QSvgRenderer>
48 #include <QMessageBox>
54 button->
setProperty(
"propertyName", propertyName );
78 if ( entryName ==
"size" )
87 label +=
" (" +
tr(
"area" ) +
")";
90 label +=
" (" +
tr(
"diameter" ) +
")";
108 btnChangeColor->setAllowAlpha(
true );
109 btnChangeColor->setColorDialogTitle(
tr(
"Select line color" ) );
110 btnChangeColor->setContext(
"symbology" );
112 spinOffset->setClearValue( 0.0 );
117 mDrawInsideCheckBox->hide();
132 if ( !layer || layer->
layerType() !=
"SimpleLine" )
139 mPenWidthUnitWidget->blockSignals(
true );
142 mPenWidthUnitWidget->blockSignals(
false );
143 mOffsetUnitWidget->blockSignals(
true );
146 mOffsetUnitWidget->blockSignals(
false );
147 mDashPatternUnitWidget->blockSignals(
true );
151 mDashPatternUnitWidget->blockSignals(
false );
154 spinWidth->blockSignals(
true );
156 spinWidth->blockSignals(
false );
157 btnChangeColor->blockSignals(
true );
159 btnChangeColor->blockSignals(
false );
160 spinOffset->blockSignals(
true );
162 spinOffset->blockSignals(
false );
163 cboPenStyle->blockSignals(
true );
164 cboJoinStyle->blockSignals(
true );
165 cboCapStyle->blockSignals(
true );
169 cboPenStyle->blockSignals(
false );
170 cboJoinStyle->blockSignals(
false );
171 cboCapStyle->blockSignals(
false );
175 mChangePatternButton->setEnabled( useCustomDashPattern );
176 label_3->setEnabled( !useCustomDashPattern );
177 cboPenStyle->setEnabled( !useCustomDashPattern );
178 mCustomCheckBox->blockSignals(
true );
179 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
180 mCustomCheckBox->blockSignals(
false );
184 mDrawInsideCheckBox->blockSignals(
true );
185 mDrawInsideCheckBox->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
186 mDrawInsideCheckBox->blockSignals(
false );
235 bool checked = ( state == Qt::Checked );
236 mChangePatternButton->setEnabled( checked );
237 label_3->setEnabled( !checked );
238 cboPenStyle->setEnabled( !checked );
247 if ( d.exec() == QDialog::Accepted )
287 bool checked = ( state == Qt::Checked );
306 mChangePatternButton->setIcon( buttonIcon );
324 btnChangeColorFill->setAllowAlpha(
true );
325 btnChangeColorFill->setColorDialogTitle(
tr(
"Select fill color" ) );
326 btnChangeColorFill->setContext(
"symbology" );
327 btnChangeColorFill->setShowNoColor(
true );
328 btnChangeColorFill->setNoColorString(
tr(
"Transparent fill" ) );
329 btnChangeColorBorder->setAllowAlpha(
true );
330 btnChangeColorBorder->setColorDialogTitle(
tr(
"Select border color" ) );
331 btnChangeColorBorder->setContext(
"symbology" );
332 btnChangeColorBorder->setShowNoColor(
true );
333 btnChangeColorBorder->setNoColorString(
tr(
"Transparent border" ) );
335 spinOffsetX->setClearValue( 0.0 );
336 spinOffsetY->setClearValue( 0.0 );
346 names <<
"circle" <<
"rectangle" <<
"diamond" <<
"pentagon" <<
"cross" <<
"cross2" <<
"triangle"
347 <<
"equilateral_triangle" <<
"star" <<
"regular_star" <<
"arrow" <<
"line" <<
"arrowhead" <<
"filled_arrowhead";
349 for (
int i = 0; i < names.
count(); ++i )
354 item->
setData( Qt::UserRole, names[i] );
358 connect( lstNames, SIGNAL( currentRowChanged(
int ) ),
this, SLOT(
setName() ) );
361 connect( spinSize, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setSize() ) );
362 connect( spinAngle, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setAngle() ) );
363 connect( spinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
364 connect( spinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
365 connect(
this, SIGNAL(
changed() ),
this, SLOT( updateAssistantSymbol() ) );
370 delete mAssistantPreviewSymbol;
375 if ( layer->
layerType() !=
"SimpleMarker" )
383 for (
int i = 0; i < lstNames->count(); ++i )
385 if ( lstNames->item( i )->data( Qt::UserRole ).toString() ==
name )
387 lstNames->setCurrentRow( i );
391 btnChangeColorBorder->blockSignals(
true );
393 btnChangeColorBorder->blockSignals(
false );
394 btnChangeColorFill->blockSignals(
true );
396 btnChangeColorFill->blockSignals(
false );
397 spinSize->blockSignals(
true );
399 spinSize->blockSignals(
false );
400 spinAngle->blockSignals(
true );
402 spinAngle->blockSignals(
false );
403 mOutlineStyleComboBox->blockSignals(
true );
405 mOutlineStyleComboBox->blockSignals(
false );
406 mOutlineWidthSpinBox->blockSignals(
true );
408 mOutlineWidthSpinBox->blockSignals(
false );
411 spinOffsetX->blockSignals(
true );
413 spinOffsetX->blockSignals(
false );
414 spinOffsetY->blockSignals(
true );
416 spinOffsetY->blockSignals(
false );
418 mSizeUnitWidget->blockSignals(
true );
421 mSizeUnitWidget->blockSignals(
false );
422 mOffsetUnitWidget->blockSignals(
true );
425 mOffsetUnitWidget->blockSignals(
false );
426 mOutlineWidthUnitWidget->blockSignals(
true );
429 mOutlineWidthUnitWidget->blockSignals(
false );
432 mHorizontalAnchorComboBox->blockSignals(
true );
433 mVerticalAnchorComboBox->blockSignals(
true );
436 mHorizontalAnchorComboBox->blockSignals(
false );
437 mVerticalAnchorComboBox->blockSignals(
false );
440 "<b>pentagon</b>|<b>triangle</b>|<b>equilateral_triangle</b>|"
441 "<b>star</b>|<b>regular_star</b>|<b>arrow</b>|<b>filled_arrowhead</b>|"
442 "<b>circle</b>|<b>cross</b>|<b>x</b>|"
443 "<b>cross2</b>|<b>line</b>|<b>arrowhead</b>]" ) );
454 updateAssistantSymbol();
464 mLayer->
setName( lstNames->currentItem()->data( Qt::UserRole ).toString() );
566 void QgsSimpleMarkerSymbolLayerV2Widget::updateAssistantSymbol()
568 for (
int i = mAssistantPreviewSymbol->
symbolLayerCount() - 1 ; i >= 0; --i )
590 btnChangeColor->setAllowAlpha(
true );
591 btnChangeColor->setColorDialogTitle(
tr(
"Select fill color" ) );
592 btnChangeColor->setContext(
"symbology" );
593 btnChangeColor->setShowNoColor(
true );
594 btnChangeColor->setNoColorString(
tr(
"Transparent fill" ) );
595 btnChangeBorderColor->setAllowAlpha(
true );
596 btnChangeBorderColor->setColorDialogTitle(
tr(
"Select border color" ) );
597 btnChangeBorderColor->setContext(
"symbology" );
598 btnChangeBorderColor->setShowNoColor(
true );
599 btnChangeBorderColor->setNoColorString(
tr(
"Transparent border" ) );
601 spinOffsetX->setClearValue( 0.0 );
602 spinOffsetY->setClearValue( 0.0 );
616 if ( layer->
layerType() !=
"SimpleFill" )
623 btnChangeColor->blockSignals(
true );
625 btnChangeColor->blockSignals(
false );
626 cboFillStyle->blockSignals(
true );
628 cboFillStyle->blockSignals(
false );
629 btnChangeBorderColor->blockSignals(
true );
631 btnChangeBorderColor->blockSignals(
false );
632 cboBorderStyle->blockSignals(
true );
634 cboBorderStyle->blockSignals(
false );
635 spinBorderWidth->blockSignals(
true );
637 spinBorderWidth->blockSignals(
false );
638 cboJoinStyle->blockSignals(
true );
640 cboJoinStyle->blockSignals(
false );
641 spinOffsetX->blockSignals(
true );
643 spinOffsetX->blockSignals(
false );
644 spinOffsetY->blockSignals(
true );
646 spinOffsetY->blockSignals(
false );
648 mBorderWidthUnitWidget->blockSignals(
true );
651 mBorderWidthUnitWidget->blockSignals(
false );
652 mOffsetUnitWidget->blockSignals(
true );
655 mOffsetUnitWidget->blockSignals(
false );
738 cboGradientColorRamp->setShowGradientOnly(
true );
741 btnChangeColor->setAllowAlpha(
true );
742 btnChangeColor->setColorDialogTitle(
tr(
"Select gradient color" ) );
743 btnChangeColor->setContext(
"symbology" );
744 btnChangeColor->setShowNoColor(
true );
745 btnChangeColor->setNoColorString(
tr(
"Transparent" ) );
746 btnChangeColor2->setAllowAlpha(
true );
747 btnChangeColor2->setColorDialogTitle(
tr(
"Select gradient color" ) );
748 btnChangeColor2->setContext(
"symbology" );
749 btnChangeColor2->setShowNoColor(
true );
750 btnChangeColor2->setNoColorString(
tr(
"Transparent" ) );
752 spinOffsetX->setClearValue( 0.0 );
753 spinOffsetY->setClearValue( 0.0 );
757 connect( cboGradientColorRamp, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT(
applyColorRamp() ) );
774 if ( layer->
layerType() !=
"GradientFill" )
781 btnChangeColor->blockSignals(
true );
783 btnChangeColor->blockSignals(
false );
784 btnChangeColor2->blockSignals(
true );
786 btnChangeColor2->blockSignals(
false );
790 radioTwoColor->setChecked(
true );
791 cboGradientColorRamp->setEnabled(
false );
795 radioColorRamp->setChecked(
true );
796 btnChangeColor->setEnabled(
false );
797 btnChangeColor2->setEnabled(
false );
803 cboGradientColorRamp->blockSignals(
true );
805 cboGradientColorRamp->blockSignals(
false );
808 cboGradientType->blockSignals(
true );
812 cboGradientType->setCurrentIndex( 0 );
815 cboGradientType->setCurrentIndex( 1 );
818 cboGradientType->setCurrentIndex( 2 );
821 cboGradientType->blockSignals(
false );
823 cboCoordinateMode->blockSignals(
true );
827 cboCoordinateMode->setCurrentIndex( 1 );
828 checkRefPoint1Centroid->setEnabled(
false );
829 checkRefPoint2Centroid->setEnabled(
false );
833 cboCoordinateMode->setCurrentIndex( 0 );
836 cboCoordinateMode->blockSignals(
false );
838 cboGradientSpread->blockSignals(
true );
842 cboGradientSpread->setCurrentIndex( 0 );
845 cboGradientSpread->setCurrentIndex( 1 );
848 cboGradientSpread->setCurrentIndex( 2 );
851 cboGradientSpread->blockSignals(
false );
853 spinRefPoint1X->blockSignals(
true );
855 spinRefPoint1X->blockSignals(
false );
856 spinRefPoint1Y->blockSignals(
true );
858 spinRefPoint1Y->blockSignals(
false );
859 checkRefPoint1Centroid->blockSignals(
true );
863 spinRefPoint1X->setEnabled(
false );
864 spinRefPoint1Y->setEnabled(
false );
866 checkRefPoint1Centroid->blockSignals(
false );
867 spinRefPoint2X->blockSignals(
true );
869 spinRefPoint2X->blockSignals(
false );
870 spinRefPoint2Y->blockSignals(
true );
872 spinRefPoint2Y->blockSignals(
false );
873 checkRefPoint2Centroid->blockSignals(
true );
877 spinRefPoint2X->setEnabled(
false );
878 spinRefPoint2Y->setEnabled(
false );
880 checkRefPoint2Centroid->blockSignals(
false );
882 spinOffsetX->blockSignals(
true );
884 spinOffsetX->blockSignals(
false );
885 spinOffsetY->blockSignals(
true );
887 spinOffsetY->blockSignals(
false );
888 mSpinAngle->blockSignals(
true );
890 mSpinAngle->blockSignals(
false );
892 mOffsetUnitWidget->blockSignals(
true );
895 mOffsetUnitWidget->blockSignals(
false );
930 if ( radioTwoColor->isChecked() )
959 if ( dlg.
exec() && gradRamp )
962 cboGradientColorRamp->blockSignals(
true );
964 cboGradientColorRamp->blockSignals(
false );
981 spinRefPoint1X->setValue( 0.5 );
982 spinRefPoint1Y->setValue( 0 );
983 spinRefPoint2X->setValue( 0.5 );
984 spinRefPoint2Y->setValue( 1 );
989 spinRefPoint1X->setValue( 0 );
990 spinRefPoint1Y->setValue( 0 );
991 spinRefPoint2X->setValue( 1 );
992 spinRefPoint2Y->setValue( 1 );
996 spinRefPoint1X->setValue( 0.5 );
997 spinRefPoint1Y->setValue( 0.5 );
998 spinRefPoint2X->setValue( 1 );
999 spinRefPoint2Y->setValue( 1 );
1014 checkRefPoint1Centroid->setEnabled(
true );
1015 checkRefPoint2Centroid->setEnabled(
true );
1021 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1022 checkRefPoint1Centroid->setEnabled(
false );
1023 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1024 checkRefPoint2Centroid->setEnabled(
false );
1091 btnChangeColor->setAllowAlpha(
true );
1092 btnChangeColor->setColorDialogTitle(
tr(
"Select gradient color" ) );
1093 btnChangeColor->setContext(
"symbology" );
1094 btnChangeColor->setShowNoColor(
true );
1095 btnChangeColor->setNoColorString(
tr(
"Transparent" ) );
1096 btnChangeColor2->setAllowAlpha(
true );
1097 btnChangeColor2->setColorDialogTitle(
tr(
"Select gradient color" ) );
1098 btnChangeColor2->setContext(
"symbology" );
1099 btnChangeColor2->setShowNoColor(
true );
1100 btnChangeColor2->setNoColorString(
tr(
"Transparent" ) );
1102 spinOffsetX->setClearValue( 0.0 );
1103 spinOffsetY->setClearValue( 0.0 );
1105 cboGradientColorRamp->setShowGradientOnly(
true );
1108 connect( cboGradientColorRamp, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT(
applyColorRamp() ) );
1115 connect( mBlurSlider, SIGNAL( valueChanged(
int ) ), mSpinBlurRadius, SLOT( setValue(
int ) ) );
1116 connect( mSpinBlurRadius, SIGNAL( valueChanged(
int ) ), mBlurSlider, SLOT( setValue(
int ) ) );
1121 if ( layer->
layerType() !=
"ShapeburstFill" )
1128 btnChangeColor->blockSignals(
true );
1130 btnChangeColor->blockSignals(
false );
1131 btnChangeColor2->blockSignals(
true );
1133 btnChangeColor2->blockSignals(
false );
1137 radioTwoColor->setChecked(
true );
1138 cboGradientColorRamp->setEnabled(
false );
1142 radioColorRamp->setChecked(
true );
1143 btnChangeColor->setEnabled(
false );
1144 btnChangeColor2->setEnabled(
false );
1147 mSpinBlurRadius->blockSignals(
true );
1148 mBlurSlider->blockSignals(
true );
1151 mSpinBlurRadius->blockSignals(
false );
1152 mBlurSlider->blockSignals(
false );
1154 mSpinMaxDistance->blockSignals(
true );
1156 mSpinMaxDistance->blockSignals(
false );
1158 mRadioUseWholeShape->blockSignals(
true );
1159 mRadioUseMaxDistance->blockSignals(
true );
1162 mRadioUseWholeShape->setChecked(
true );
1163 mSpinMaxDistance->setEnabled(
false );
1164 mDistanceUnitWidget->setEnabled(
false );
1168 mRadioUseMaxDistance->setChecked(
true );
1169 mSpinMaxDistance->setEnabled(
true );
1170 mDistanceUnitWidget->setEnabled(
true );
1172 mRadioUseWholeShape->blockSignals(
false );
1173 mRadioUseMaxDistance->blockSignals(
false );
1175 mDistanceUnitWidget->blockSignals(
true );
1178 mDistanceUnitWidget->blockSignals(
false );
1180 mIgnoreRingsCheckBox->blockSignals(
true );
1181 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1182 mIgnoreRingsCheckBox->blockSignals(
false );
1187 cboGradientColorRamp->blockSignals(
true );
1189 cboGradientColorRamp->blockSignals(
false );
1192 spinOffsetX->blockSignals(
true );
1194 spinOffsetX->blockSignals(
false );
1195 spinOffsetY->blockSignals(
true );
1197 spinOffsetY->blockSignals(
false );
1198 mOffsetUnitWidget->blockSignals(
true );
1201 mOffsetUnitWidget->blockSignals(
false );
1241 if ( radioTwoColor->isChecked() )
1285 mDistanceUnitWidget->setEnabled( !value );
1308 if ( dlg.
exec() && gradRamp )
1311 cboGradientColorRamp->blockSignals(
true );
1313 cboGradientColorRamp->blockSignals(
false );
1345 bool checked = ( state == Qt::Checked );
1362 spinOffset->setClearValue( 0.0 );
1364 connect( spinInterval, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setInterval(
double ) ) );
1366 connect( chkRotateMarker, SIGNAL( clicked() ),
this, SLOT(
setRotate() ) );
1367 connect( spinOffset, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
1377 if ( layer->
layerType() !=
"MarkerLine" )
1384 spinInterval->blockSignals(
true );
1386 spinInterval->blockSignals(
false );
1387 mSpinOffsetAlongLine->blockSignals(
true );
1389 mSpinOffsetAlongLine->blockSignals(
false );
1390 chkRotateMarker->blockSignals(
true );
1392 chkRotateMarker->blockSignals(
false );
1393 spinOffset->blockSignals(
true );
1395 spinOffset->blockSignals(
false );
1397 radInterval->setChecked(
true );
1399 radVertex->setChecked(
true );
1401 radVertexLast->setChecked(
true );
1403 radCentralPoint->setChecked(
true );
1405 radVertexFirst->setChecked(
true );
1408 mIntervalUnitWidget->blockSignals(
true );
1411 mIntervalUnitWidget->blockSignals(
false );
1412 mOffsetUnitWidget->blockSignals(
true );
1415 mOffsetUnitWidget->blockSignals(
false );
1416 mOffsetAlongLineUnitWidget->blockSignals(
true );
1419 mOffsetAlongLineUnitWidget->blockSignals(
false );
1460 bool interval = radInterval->isChecked();
1461 spinInterval->setEnabled( interval );
1462 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
1464 if ( radInterval->isChecked() )
1466 else if ( radVertex->isChecked() )
1468 else if ( radVertexLast->isChecked() )
1470 else if ( radVertexFirst->isChecked() )
1520 viewGroups->setHeaderHidden(
true );
1522 mChangeColorButton->setColorDialogTitle(
tr(
"Select fill color" ) );
1523 mChangeColorButton->setContext(
"symbology" );
1524 mChangeBorderColorButton->setColorDialogTitle(
tr(
"Select border color" ) );
1525 mChangeColorButton->setContext(
"symbology" );
1527 spinOffsetX->setClearValue( 0.0 );
1528 spinOffsetY->setClearValue( 0.0 );
1534 connect( spinSize, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setSize() ) );
1535 connect( spinAngle, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setAngle() ) );
1536 connect( spinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
1537 connect( spinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
1538 connect(
this, SIGNAL(
changed() ),
this, SLOT( updateAssistantSymbol() ) );
1548 delete mAssistantPreviewSymbol;
1552 #include <QAbstractListModel>
1553 #include <QPixmapCache>
1580 if ( role == Qt::DecorationRole )
1587 double outlineWidth;
1588 bool fillParam, outlineParam, outlineWidthParam;
1599 else if ( role == Qt::UserRole || role == Qt::ToolTipRole )
1619 for (
int i = 0; i < svgPaths.
size(); i++ )
1621 QDir dir( svgPaths[i] );
1642 createTree( baseGroup );
1650 foreach (
QString item, parentDir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
1659 createTree( group );
1667 viewGroups->setModel( g );
1670 for (
int i = 0; i < rows; i++ )
1677 viewImages->setModel( m );
1685 viewImages->setModel( m );
1699 bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
1700 QColor defaultFill, defaultOutline;
1701 double defaultOutlineWidth;
1703 mChangeColorButton->setEnabled( hasFillParam );
1704 mChangeBorderColorButton->setEnabled( hasOutlineParam );
1705 mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );
1711 mChangeColorButton->setColor( layer->
fillColor() );
1715 mChangeColorButton->setColor( defaultFill );
1718 if ( hasOutlineParam )
1722 mChangeBorderColorButton->setColor( layer->
outlineColor() );
1726 mChangeBorderColorButton->setColor( defaultOutline );
1730 mFileLineEdit->blockSignals(
true );
1731 mFileLineEdit->setText( layer->
path() );
1732 mFileLineEdit->blockSignals(
false );
1734 mBorderWidthSpinBox->blockSignals(
true );
1735 mBorderWidthSpinBox->setValue( layer->
outlineWidth() );
1736 mBorderWidthSpinBox->blockSignals(
false );
1739 void QgsSvgMarkerSymbolLayerV2Widget::updateAssistantSymbol()
1741 for (
int i = mAssistantPreviewSymbol->
symbolLayerCount() - 1 ; i >= 0; --i )
1759 if ( layer->
layerType() !=
"SvgMarker" )
1769 for (
int i = 0; i < m->
rowCount(); i++ )
1774 selModel->
select( idx, QItemSelectionModel::SelectCurrent );
1781 spinSize->blockSignals(
true );
1783 spinSize->blockSignals(
false );
1784 spinAngle->blockSignals(
true );
1786 spinAngle->blockSignals(
false );
1789 spinOffsetX->blockSignals(
true );
1791 spinOffsetX->blockSignals(
false );
1792 spinOffsetY->blockSignals(
true );
1794 spinOffsetY->blockSignals(
false );
1796 mSizeUnitWidget->blockSignals(
true );
1799 mSizeUnitWidget->blockSignals(
false );
1800 mBorderWidthUnitWidget->blockSignals(
true );
1803 mBorderWidthUnitWidget->blockSignals(
false );
1804 mOffsetUnitWidget->blockSignals(
true );
1807 mOffsetUnitWidget->blockSignals(
false );
1810 mHorizontalAnchorComboBox->blockSignals(
true );
1811 mVerticalAnchorComboBox->blockSignals(
true );
1814 mHorizontalAnchorComboBox->blockSignals(
false );
1815 mVerticalAnchorComboBox->blockSignals(
false );
1829 updateAssistantSymbol();
1841 mFileLineEdit->setText( name );
1869 tr(
"Select SVG file" ),
1871 tr(
"SVG files" ) +
" (*.svg)" );
1873 if ( file.
isEmpty() || !fi.exists() )
1877 mFileLineEdit->setText( file );
1879 s.
setValue(
"/UI/lastSVGMarkerDir", fi.absolutePath() );
1896 if ( !
QFileInfo( mFileLineEdit->text() ).exists() )
1898 QUrl url( mFileLineEdit->text() );
1899 if ( !url.isValid() )
2000 mSvgTreeView->setHeaderHidden(
true );
2003 mChangeColorButton->setColorDialogTitle(
tr(
"Select fill color" ) );
2004 mChangeColorButton->setContext(
"symbology" );
2005 mChangeBorderColorButton->setColorDialogTitle(
tr(
"Select border color" ) );
2006 mChangeBorderColorButton->setContext(
"symbology" );
2028 mTextureWidthSpinBox->blockSignals(
true );
2029 mTextureWidthSpinBox->setValue( width );
2030 mTextureWidthSpinBox->blockSignals(
false );
2032 mRotationSpinBox->blockSignals(
true );
2034 mRotationSpinBox->blockSignals(
false );
2035 mTextureWidthUnitWidget->blockSignals(
true );
2038 mTextureWidthUnitWidget->blockSignals(
false );
2039 mSvgOutlineWidthUnitWidget->blockSignals(
true );
2042 mSvgOutlineWidthUnitWidget->blockSignals(
false );
2043 mChangeColorButton->blockSignals(
true );
2045 mChangeColorButton->blockSignals(
false );
2046 mChangeBorderColorButton->blockSignals(
true );
2048 mChangeBorderColorButton->blockSignals(
false );
2049 mBorderWidthSpinBox->blockSignals(
true );
2051 mBorderWidthSpinBox->blockSignals(
false );
2068 void QgsSVGFillSymbolLayerWidget::on_mBrowseToolButton_clicked()
2071 if ( !filePath.
isNull() )
2073 mSVGLineEdit->setText( filePath );
2078 void QgsSVGFillSymbolLayerWidget::on_mTextureWidthSpinBox_valueChanged(
double d )
2087 void QgsSVGFillSymbolLayerWidget::on_mSVGLineEdit_textEdited(
const QString & text )
2104 void QgsSVGFillSymbolLayerWidget::on_mSVGLineEdit_editingFinished()
2114 QUrl url( mSVGLineEdit->text() );
2115 if ( !url.isValid() )
2129 void QgsSVGFillSymbolLayerWidget::setFile(
const QModelIndex& item )
2133 mSVGLineEdit->setText( file );
2142 mSvgTreeView->setModel( g );
2145 for (
int i = 0; i < rows; i++ )
2151 mSvgListView->setModel( m );
2154 void QgsSVGFillSymbolLayerWidget::populateIcons(
const QModelIndex& idx )
2159 mSvgListView->setModel( m );
2166 void QgsSVGFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged(
double d )
2178 bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
2179 QColor defaultFill, defaultOutline;
2180 double defaultOutlineWidth;
2182 if ( hasFillParam && resetValues )
2184 mChangeColorButton->setColor( defaultFill );
2186 mChangeColorButton->setEnabled( hasFillParam );
2187 if ( hasOutlineParam && resetValues )
2189 mChangeBorderColorButton->setColor( defaultOutline );
2191 mChangeBorderColorButton->setEnabled( hasOutlineParam );
2192 if ( hasOutlineWidthParam && resetValues )
2194 mBorderWidthSpinBox->setValue( defaultOutlineWidth );
2196 mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );
2199 void QgsSVGFillSymbolLayerWidget::on_mChangeColorButton_colorChanged(
const QColor& color )
2210 void QgsSVGFillSymbolLayerWidget::on_mChangeBorderColorButton_colorChanged(
const QColor& color )
2221 void QgsSVGFillSymbolLayerWidget::on_mBorderWidthSpinBox_valueChanged(
double d )
2230 void QgsSVGFillSymbolLayerWidget::on_mTextureWidthUnitWidget_changed()
2240 void QgsSVGFillSymbolLayerWidget::on_mSvgOutlineWidthUnitWidget_changed()
2262 if ( layer->
layerType() !=
"LinePatternFill" )
2271 mAngleSpinBox->blockSignals(
true );
2273 mAngleSpinBox->blockSignals(
false );
2274 mDistanceSpinBox->blockSignals(
true );
2276 mDistanceSpinBox->blockSignals(
false );
2277 mOffsetSpinBox->blockSignals(
true );
2279 mOffsetSpinBox->blockSignals(
false );
2282 mDistanceUnitWidget->blockSignals(
true );
2285 mDistanceUnitWidget->blockSignals(
false );
2286 mOffsetUnitWidget->blockSignals(
true );
2289 mOffsetUnitWidget->blockSignals(
false );
2301 void QgsLinePatternFillSymbolLayerWidget::on_mAngleSpinBox_valueChanged(
double d )
2310 void QgsLinePatternFillSymbolLayerWidget::on_mDistanceSpinBox_valueChanged(
double d )
2319 void QgsLinePatternFillSymbolLayerWidget::on_mOffsetSpinBox_valueChanged(
double d )
2328 void QgsLinePatternFillSymbolLayerWidget::on_mDistanceUnitWidget_changed()
2338 void QgsLinePatternFillSymbolLayerWidget::on_mOffsetUnitWidget_changed()
2363 if ( !layer || layer->
layerType() !=
"PointPatternFill" )
2369 mHorizontalDistanceSpinBox->blockSignals(
true );
2371 mHorizontalDistanceSpinBox->blockSignals(
false );
2372 mVerticalDistanceSpinBox->blockSignals(
true );
2374 mVerticalDistanceSpinBox->blockSignals(
false );
2375 mHorizontalDisplacementSpinBox->blockSignals(
true );
2377 mHorizontalDisplacementSpinBox->blockSignals(
false );
2378 mVerticalDisplacementSpinBox->blockSignals(
true );
2380 mVerticalDisplacementSpinBox->blockSignals(
false );
2382 mHorizontalDistanceUnitWidget->blockSignals(
true );
2385 mHorizontalDistanceUnitWidget->blockSignals(
false );
2386 mVerticalDistanceUnitWidget->blockSignals(
true );
2389 mVerticalDistanceUnitWidget->blockSignals(
false );
2390 mHorizontalDisplacementUnitWidget->blockSignals(
true );
2393 mHorizontalDisplacementUnitWidget->blockSignals(
false );
2394 mVerticalDisplacementUnitWidget->blockSignals(
true );
2397 mVerticalDisplacementUnitWidget->blockSignals(
false );
2410 void QgsPointPatternFillSymbolLayerWidget::on_mHorizontalDistanceSpinBox_valueChanged(
double d )
2419 void QgsPointPatternFillSymbolLayerWidget::on_mVerticalDistanceSpinBox_valueChanged(
double d )
2428 void QgsPointPatternFillSymbolLayerWidget::on_mHorizontalDisplacementSpinBox_valueChanged(
double d )
2437 void QgsPointPatternFillSymbolLayerWidget::on_mVerticalDisplacementSpinBox_valueChanged(
double d )
2446 void QgsPointPatternFillSymbolLayerWidget::on_mHorizontalDistanceUnitWidget_changed()
2456 void QgsPointPatternFillSymbolLayerWidget::on_mVerticalDistanceUnitWidget_changed()
2466 void QgsPointPatternFillSymbolLayerWidget::on_mHorizontalDisplacementUnitWidget_changed()
2476 void QgsPointPatternFillSymbolLayerWidget::on_mVerticalDisplacementUnitWidget_changed()
2499 btnColor->setAllowAlpha(
true );
2500 btnColor->setColorDialogTitle(
tr(
"Select symbol color" ) );
2501 btnColor->setContext(
"symbology" );
2503 spinOffsetX->setClearValue( 0.0 );
2504 spinOffsetY->setClearValue( 0.0 );
2513 connect( spinSize, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setSize(
double ) ) );
2515 connect( spinAngle, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setAngle(
double ) ) );
2516 connect( spinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
2517 connect( spinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
2519 connect(
this, SIGNAL(
changed() ),
this, SLOT( updateAssistantSymbol() ) );
2524 delete mAssistantPreviewSymbol;
2529 if ( layer->
layerType() !=
"FontMarker" )
2537 cboFont->blockSignals(
true );
2538 cboFont->setCurrentFont( layerFont );
2539 cboFont->blockSignals(
false );
2540 spinSize->blockSignals(
true );
2542 spinSize->blockSignals(
false );
2543 btnColor->blockSignals(
true );
2545 btnColor->blockSignals(
false );
2546 spinAngle->blockSignals(
true );
2548 spinAngle->blockSignals(
false );
2556 spinOffsetX->blockSignals(
true );
2558 spinOffsetX->blockSignals(
false );
2559 spinOffsetY->blockSignals(
true );
2561 spinOffsetY->blockSignals(
false );
2563 mSizeUnitWidget->blockSignals(
true );
2566 mSizeUnitWidget->blockSignals(
false );
2568 mOffsetUnitWidget->blockSignals(
true );
2571 mOffsetUnitWidget->blockSignals(
false );
2574 mHorizontalAnchorComboBox->blockSignals(
true );
2575 mVerticalAnchorComboBox->blockSignals(
true );
2578 mHorizontalAnchorComboBox->blockSignals(
false );
2579 mVerticalAnchorComboBox->blockSignals(
false );
2589 updateAssistantSymbol();
2673 void QgsFontMarkerSymbolLayerV2Widget::updateAssistantSymbol()
2675 for (
int i = mAssistantPreviewSymbol->
symbolLayerCount() - 1 ; i >= 0; --i )
2698 if ( layer->
layerType() !=
"CentroidFill" )
2705 mDrawInsideCheckBox->blockSignals(
true );
2707 mDrawInsideCheckBox->blockSignals(
false );
2732 mSpinOffsetX->setClearValue( 0.0 );
2733 mSpinOffsetY->setClearValue( 0.0 );
2735 connect( cboCoordinateMode, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT( setCoordinateMode(
int ) ) );
2736 connect( mSpinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT( offsetChanged() ) );
2737 connect( mSpinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT( offsetChanged() ) );
2747 if ( layer->
layerType() !=
"RasterFill" )
2758 mImageLineEdit->blockSignals(
true );
2760 mImageLineEdit->blockSignals(
false );
2762 cboCoordinateMode->blockSignals(
true );
2766 cboCoordinateMode->setCurrentIndex( 1 );
2770 cboCoordinateMode->setCurrentIndex( 0 );
2773 cboCoordinateMode->blockSignals(
false );
2774 mSpinTransparency->blockSignals(
true );
2775 mSpinTransparency->setValue(
mLayer->
alpha() * 100.0 );
2776 mSpinTransparency->blockSignals(
false );
2777 mSliderTransparency->blockSignals(
true );
2778 mSliderTransparency->setValue(
mLayer->
alpha() * 100.0 );
2779 mSliderTransparency->blockSignals(
false );
2780 mRotationSpinBox->blockSignals(
true );
2782 mRotationSpinBox->blockSignals(
false );
2784 mSpinOffsetX->blockSignals(
true );
2786 mSpinOffsetX->blockSignals(
false );
2787 mSpinOffsetY->blockSignals(
true );
2789 mSpinOffsetY->blockSignals(
false );
2790 mOffsetUnitWidget->blockSignals(
true );
2793 mOffsetUnitWidget->blockSignals(
false );
2795 mWidthSpinBox->blockSignals(
true );
2797 mWidthSpinBox->blockSignals(
false );
2798 mWidthUnitWidget->blockSignals(
true );
2801 mWidthUnitWidget->blockSignals(
false );
2802 updatePreviewImage();
2815 void QgsRasterFillSymbolLayerWidget::on_mBrowseToolButton_clicked()
2819 QString lineEditText = mImageLineEdit->text();
2820 if ( !lineEditText.
isEmpty() )
2822 QFileInfo openDirFileInfo( lineEditText );
2823 openDir = openDirFileInfo.path();
2828 openDir = s.
value(
"/UI/lastRasterFillImageDir",
"" ).
toString();
2833 if ( !filePath.
isNull() )
2837 if ( !fileInfo.exists() || !fileInfo.isReadable() )
2843 s.
setValue(
"/UI/lastRasterFillImageDir", fileInfo.absolutePath() );
2844 mImageLineEdit->setText( filePath );
2845 on_mImageLineEdit_editingFinished();
2849 void QgsRasterFillSymbolLayerWidget::on_mImageLineEdit_editingFinished()
2859 QUrl url( mImageLineEdit->text() );
2860 if ( !url.isValid() )
2868 updatePreviewImage();
2874 void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
2891 void QgsRasterFillSymbolLayerWidget::on_mSpinTransparency_valueChanged(
int value )
2900 updatePreviewImage();
2903 void QgsRasterFillSymbolLayerWidget::offsetChanged()
2909 void QgsRasterFillSymbolLayerWidget::on_mOffsetUnitWidget_changed()
2920 void QgsRasterFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged(
double d )
2929 void QgsRasterFillSymbolLayerWidget::on_mWidthUnitWidget_changed()
2940 void QgsRasterFillSymbolLayerWidget::on_mWidthSpinBox_valueChanged(
double d )
2951 void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
2959 if ( image.isNull() )
2961 mLabelImagePreview->setPixmap(
QPixmap() );
2965 if ( image.height() > 150 || image.width() > 150 )
2967 image = image.
scaled( 150, 150, Qt::KeepAspectRatio, Qt::SmoothTransformation );
2970 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
2971 previewImage.fill( Qt::transparent );
2972 QRect imageRect(( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
2974 p.
begin( &previewImage );
2976 uchar pixDataRGB[] = { 150, 150, 150, 150,
2981 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
2985 p.fillRect( imageRect, checkerBrush );
2992 p.drawImage( imageRect.left(), imageRect.top(), image );
void setIntervalUnit(QgsSymbolV2::OutputUnit unit)
QColor borderColor() const
QgsSymbolV2::OutputUnit customDashPatternUnit() const
void setBorderWidthMapUnitScale(const QgsMapUnitScale &scale)
QgsVectorColorRampV2 * colorRamp()
Color ramp used for the gradient fill, only used if the gradient color type is set to ColorRamp...
VerticalAnchorPoint verticalAnchorPoint() const
bool ignoreRings() const
Returns whether the shapeburst fill is set to ignore polygon interior rings.
QgsSymbolV2::OutputUnit intervalUnit() const
QgsSymbolV2::OutputUnit patternWidthUnit() const
void setDistanceUnit(QgsSymbolV2::OutputUnit unit)
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary...
void setOutlineStyle(Qt::PenStyle outlineStyle)
QgsSymbolV2::OutputUnit outlineWidthUnit() const
static const QString pkgDataPath()
Returns the common root path of all application data directories.
double borderWidth() const
void setMaxDistance(double maxDistance)
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
const QgsMapUnitScale & patternWidthMapUnitScale() const
QgsVectorColorRampV2 * colorRamp()
Returns the color ramp used for the shapeburst fill.
bool deleteSymbolLayer(int index)
delete symbol layer at specified index
void setDistance(double d)
double outlineWidth() const
QgsSymbolV2::OutputUnit distanceYUnit() const
virtual int rowCount(const QModelIndex &parent) const =0
void setReferencePoint1(QPointF referencePoint)
Starting point of gradient fill, in the range [0,0] - [1,1].
QgsSymbolV2::OutputUnit offsetAlongLineUnit() const
Returns the unit used for calculating the offset along line for markers.
void setReferencePoint2IsCentroid(bool isCentroid)
Sets the end point of the gradient to be the feature centroid.
void setSvgOutlineWidth(double w)
const QgsMapUnitScale & displacementXMapUnitScale() const
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
void setIcon(const QIcon &icon)
A container class for data source field mapping or expression.
virtual QString type() const =0
static QIcon symbolLayerPreviewIcon(QgsSymbolLayerV2 *layer, QgsSymbolV2::OutputUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
void setCoordinateMode(GradientCoordinateMode coordinateMode)
virtual double width() const
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QgsSymbolV2::OutputUnit distanceXUnit() const
void setSvgFillColor(const QColor &c)
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
HorizontalAnchorPoint horizontalAnchorPoint() const
static const QStringList svgPaths()
Returns the pathes to svg directories.
QgsSymbolV2::OutputUnit offsetUnit() const
void setDistanceYUnit(QgsSymbolV2::OutputUnit unit)
QStandardItem * invisibleRootItem() const
QString svgFilePath() const
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
const QgsMapUnitScale & customDashPatternMapUnitScale() const
QgsSymbolLayerV2 * clone() const override
QPointF referencePoint2() const
void setOutlineColor(const QColor &c) override
Set outline color.
void setDataDefinedSize(const QgsDataDefined &dd)
Set data defined size for whole symbol (including all symbol layers).
double displacementX() const
void setCustomDashPatternUnit(QgsSymbolV2::OutputUnit unit)
double svgOutlineWidth() const
void setPointOnSurface(bool pointOnSurface)
bool useCustomDashPattern() const
QgsSymbolV2::OutputUnit svgOutlineWidthUnit() const
void setIgnoreRings(bool ignoreRings)
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading...
const T & at(int i) const
void setOffset(QPointF offset)
void setUseCustomDashPattern(bool b)
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
const QgsMapUnitScale & widthMapUnitScale() const
Returns the map unit scale for the image's width.
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
void setColor2(QColor color2)
Sets the color for the endpoint of the shapeburst fill.
QVector< qreal > customDashVector() const
void setOutlineWidth(double w)
const QgsMapUnitScale & intervalMapUnitScale() const
void setPenJoinStyle(Qt::PenJoinStyle style)
bool referencePoint2IsCentroid() const
QgsSymbolLayerV2 * clone() const override
void setVerticalAnchorPoint(VerticalAnchorPoint v)
QPixmap fromImage(const QImage &image, QFlags< Qt::ImageConversionFlag > flags)
GradientCoordinateMode coordinateMode() const
Coordinate mode for gradient.
void setDistanceXMapUnitScale(const QgsMapUnitScale &scale)
int blurRadius() const
Returns the blur radius, which controls the amount of blurring applied to the fill.
QgsSymbolV2::OutputUnit sizeUnit() const
void setOutlineWidth(double w)
QColor fillColor() const override
Get fill color.
void setBorderColor(QColor borderColor)
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setSvgOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
const QgsMapUnitScale & borderWidthMapUnitScale() const
void setMapUnitScale(const QgsMapUnitScale &scale) override
static const QString qgisSettingsDirPath()
Returns the path to the settings directory in user's home dir.
QString tr(const char *sourceText, const char *disambiguation, int n)
QgsSymbolLayerV2 * clone() const override
void setColorRamp(QgsVectorColorRampV2 *ramp)
Qt::PenStyle penStyle() const
void setWidthUnit(QgsSymbolV2::OutputUnit unit)
void setPatternWidth(double width)
virtual void setData(const QVariant &value, int role)
void setFontFamily(QString family)
QgsSymbolV2::OutputUnit offsetUnit() const
Returns the units used for the offset of the shapeburst fill.
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
void setSvgOutlineColor(const QColor &c)
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the marker placement.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setInterval(double interval)
void setDistanceUnit(QgsSymbolV2::OutputUnit unit)
void containsParams(const QString &path, bool &hasFillParam, QColor &defaultFillColor, bool &hasOutlineParam, QColor &defaultOutlineColor, bool &hasOutlineWidthParam, double &defaultOutlineWidth) const
Tests if an svg file contains parameters for fill, outline color, outline width.
static QgsSvgCache * instance()
void setDrawInsidePolygon(bool drawInsidePolygon)
void setGradientType(GradientType gradientType)
void setValue(const QString &key, const QVariant &value)
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
void setRotateMarker(bool rotate)
QgsSymbolV2::OutputUnit distanceUnit() const
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary...
const QImage & svgAsImage(const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor, bool &fitsInCache)
Get SVG as QImage.
const char * name() const
QgsSymbolV2::OutputUnit offsetUnit() const
QgsSymbolLayerV2 * clone() const override
void setLineAngle(double a)
void setImageFilePath(const QString &imagePath)
Sets the path to the raster image used for the fill.
double offsetAlongLine() const
Returns the offset along the line for the marker placement.
int count(const T &value) const
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit u)
A class for filling symbols with a repeated raster image.
void setOffset(QPointF offset)
Sets the offset for the shapeburst fill.
Qt::PenStyle borderStyle() const
A dialog to enter a custom dash space pattern for lines.
void setOffset(double offset)
bool appendSymbolLayer(QgsSymbolLayerV2 *layer)
append symbol layer at the end of the list
void setMapUnitScale(const QgsMapUnitScale &scale) override
QVariant property(const char *name) const
bool drawInsidePolygon() const
void setWidth(const double width)
Sets the width for scaling the image used in the fill.
QModelIndex indexFromItem(const QStandardItem *item) const
const QgsMapUnitScale & offsetMapUnitScale() const
Returns the map unit scale for the fill's offset.
void setPenJoinStyle(Qt::PenJoinStyle style)
void setBrushStyle(Qt::BrushStyle style)
void setReferencePoint1IsCentroid(bool isCentroid)
Sets the starting point of the gradient to be the feature centroid.
void setBlurRadius(int blurRadius)
Sets the blur radius, which controls the amount of blurring applied to the fill.
virtual QgsVectorColorRampV2 * clone() const =0
bool useWholeShape() const
Returns whether the shapeburst fill is set to cover the entire shape.
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
void appendRow(const QList< QStandardItem * > &items)
static QStringList listSvgFiles()
Return a list of all available svg files.
QgsSvgListModel(QObject *parent, QString path)
const QgsMapUnitScale & offsetMapUnitScale() const
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
virtual void setWidth(double width)
QString fontFamily() const
static QgsStyleV2 * defaultStyle()
return default application-wide style
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the image's width.
virtual void select(const QModelIndex &index, QFlags< QItemSelectionModel::SelectionFlag > command)
QPointF offset() const
Returns the offset for the shapeburst fill.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
double outlineWidth() const
const QgsMapUnitScale & distanceXMapUnitScale() const
void setAngle(double angle)
QString imageFilePath() const
The path to the raster image used for the fill.
void setSizeUnit(QgsSymbolV2::OutputUnit unit)
bool rotateMarker() const
void setOverrideCursor(const QCursor &cursor)
void setDistanceYMapUnitScale(const QgsMapUnitScale &scale)
void setPath(QString path)
QColor svgFillColor() const
const QgsMapUnitScale & sizeMapUnitScale() const
int symbolLayerCount()
Returns total number of symbol layers contained in the symbol.
void restoreOverrideCursor()
QgsSymbolV2::OutputUnit distanceUnit() const
ShapeburstColorType colorType() const
Returns the color mode used for the shapeburst fill.
double patternWidth() const
QgsSymbolV2::OutputUnit borderWidthUnit() const
QGis::GeometryType geometryType() const
Returns point, line or polygon.
virtual QColor color() const
virtual QVariant data(const QModelIndex &index, int role) const =0
void setOffsetAlongLineMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset in map units along line for markers...
GradientColorType gradientColorType() const
Gradient color mode, controls how gradient color stops are created.
void setDisplacementXUnit(QgsSymbolV2::OutputUnit unit)
void setCoordinateMode(const FillCoordinateMode mode)
Set the coordinate mode for fill.
void setOffsetAlongLineUnit(QgsSymbolV2::OutputUnit unit)
Sets the unit used for calculating the offset along line for markers.
static QStringList listSvgFilesAt(QString directory)
Return a list of svg files at the specified directory.
void setBorderWidthUnit(QgsSymbolV2::OutputUnit unit)
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
void setPenCapStyle(Qt::PenCapStyle style)
void setCustomDashVector(const QVector< qreal > &vector)
void setDisplacementXMapUnitScale(const QgsMapUnitScale &scale)
QgsSymbolV2::ScaleMethod scaleMethod() const
QPointF referencePoint1() const
const QgsMapUnitScale & displacementYMapUnitScale() const
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
void setColorType(ShapeburstColorType colorType)
Sets the color mode to use for the shapeburst fill.
void setDistanceXUnit(QgsSymbolV2::OutputUnit unit)
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
QColor svgOutlineColor() const
QStandardItem * item(int row, int column) const
bool blockSignals(bool block)
bool contains(QChar ch, Qt::CaseSensitivity cs) const
GradientSpread gradientSpread() const
Gradient spread mode.
const QgsMapUnitScale & distanceMapUnitScale() const
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
QColor color2() const
Returns the color used for the endpoint of the shapeburst fill.
void setOffset(QPointF offset)
Offset for gradient fill.
virtual QString layerType() const =0
void setDisplacementY(double d)
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
const double DEFAULT_POINT_SIZE
Magic number that determines the default point size for point symbols.
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
Sets the units used for the offset for the shapeburst fill.
bool pointOnSurface() const
void setOffset(QPointF offset)
void setTexture(const QPixmap &pixmap)
const QgsMapUnitScale & offsetMapUnitScale() const
QgsSymbolV2::OutputUnit outlineWidthUnit() const
QgsSvgListModel(QObject *parent)
A class for svg fill patterns.
QgsSymbolV2::OutputUnit offsetUnit() const
Returns the units for the fill's offset.
void setMapUnitScale(const QgsMapUnitScale &scale) override
QVariant value(const QString &key, const QVariant &defaultValue) const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the fill's offset.
const QgsMapUnitScale & distanceMapUnitScale() const
void setGradientColorType(GradientColorType gradientColorType)
const QgsMapUnitScale & offsetMapUnitScale() const
QColor color2() const
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor.
void setPenStyle(Qt::PenStyle style)
QPointF offset() const
Returns the offset for the fill.
QgsSymbolV2::OutputUnit offsetUnit() const
QVariant data(int role) const
void setPlacement(Placement p)
const QgsMapUnitScale & outlineWidthMapUnitScale() const
const QgsMapUnitScale & offsetMapUnitScale() const
Qt::PenStyle outlineStyle() const
const QgsMapUnitScale & widthMapUnitScale() const
FillCoordinateMode coordinateMode() const
Coordinate mode for fill.
void setDisplacementYUnit(QgsSymbolV2::OutputUnit unit)
const QgsMapUnitScale & distanceYMapUnitScale() const
QgsSymbolV2::OutputUnit displacementYUnit() const
bool referencePoint1IsCentroid() const
void setCustomDashPatternMapUnitScale(const QgsMapUnitScale &scale)
void setSvgFilePath(const QString &svgPath)
void setUseWholeShape(bool useWholeShape)
Sets whether the shapeburst fill should be drawn using the entire shape.
virtual QgsDataDefined * getDataDefinedProperty(const QString &property) const
Returns the data defined property corresponding to the specified property key.
Qt::PenJoinStyle penJoinStyle() const
QPixmap * find(const QString &key)
void setColorRamp(QgsVectorColorRampV2 *ramp)
Sets the color ramp used to draw the shapeburst fill.
void setOffset(const QPointF &offset)
Sets the offset for the fill.
const QgsMapUnitScale & offsetMapUnitScale() const
StandardButton critical(QWidget *parent, const QString &title, const QString &text, QFlags< QMessageBox::StandardButton > buttons, StandardButton defaultButton)
virtual int rowCount(const QModelIndex &parent) const
void setDistanceY(double d)
void setDisplacementYMapUnitScale(const QgsMapUnitScale &scale)
void setAlpha(const double alpha)
Sets the opacity for the raster image used in the fill.
void setName(QString name)
virtual void setColor(const QColor &color)
Placement placement() const
GradientType gradientType() const
Type of gradient, eg linear or radial.
QColor borderColor() const
QgsSvgGroupsModel(QObject *parent)
void setCurrentIndex(const QModelIndex &index, QFlags< QItemSelectionModel::SelectionFlag > command)
void setDistanceX(double d)
bool setProperty(const char *name, const QVariant &value)
void setBorderColor(QColor color)
void setMapUnitScale(const QgsMapUnitScale &scale) override
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
QgsSymbolV2::OutputUnit widthUnit() const
Returns the units for the image's width.
void setOffset(double offset)
void setWidthUnit(const QgsSymbolV2::OutputUnit unit)
Sets the units for the image's width.
void setPatternWidthUnit(QgsSymbolV2::OutputUnit unit)
QgsSymbolV2::OutputUnit displacementXUnit() const
void setGradientSpread(GradientSpread gradientSpread)
double width() const
Returns the width used for scaling the image used in the fill.
bool insert(const QString &key, const QPixmap &pixmap)
QgsSymbolV2::OutputUnit offsetUnit() const
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setSize(double size)
void setAngle(double angle)
Represents a vector layer which manages a vector based data sets.
bool begin(QPaintDevice *device)
void setReferencePoint2(QPointF referencePoint)
End point of gradient fill, in the range [0,0] - [1,1].
const QgsMapUnitScale & offsetMapUnitScale() const
void setBorderWidth(double borderWidth)
const QgsMapUnitScale & offsetAlongLineMapUnitScale() const
Returns the map unit scale used for calculating the offset in map units along line for markers...
const QgsMapUnitScale & svgOutlineWidthMapUnitScale() const
void setDisplacementX(double d)
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
QColor outlineColor() const override
Get outline color.
void setCheckable(bool checkable)
const QgsMapUnitScale & outlineWidthMapUnitScale() const
double displacementY() const
virtual QVariant data(int role) const
Qt::BrushStyle brushStyle() const
void setEditable(bool editable)
QgsSymbolV2::OutputUnit widthUnit() const
void setOffsetUnit(const QgsSymbolV2::OutputUnit unit)
Sets the units for the fill's offset.
void setCharacter(QChar ch)
QImage scaled(int width, int height, Qt::AspectRatioMode aspectRatioMode, Qt::TransformationMode transformMode) const
void setDistanceMapUnitScale(const QgsMapUnitScale &scale)
Qt::PenJoinStyle penJoinStyle() const
void setFillColor(const QColor &c) override
Set fill color.
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
Units for gradient fill offset.
QgsSymbolV2::OutputUnit offsetUnit() const
Qt::PenCapStyle penCapStyle() const
double maxDistance() const
Returns the maximum distance from the shape's boundary which is shaded.
void setSvgOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
double alpha() const
The opacity for the raster image used in the fill.
virtual Q_DECL_DEPRECATED void setDataDefinedProperty(const QString &property, const QString &expressionString)
Sets a data defined expression for a property.
void setColor2(QColor color2)
void setBorderStyle(Qt::PenStyle borderStyle)