39 #include <QAbstractButton>
40 #include <QColorDialog>
43 #include <QFileDialog>
46 #include <QStandardItemModel>
47 #include <QSvgRenderer>
48 #include <QMessageBox>
106 button->
setProperty(
"propertyName", propertyName );
132 if ( entryName ==
"size" )
134 label =
tr(
"Size" );
141 label +=
" (" +
tr(
"area" ) +
")";
144 label +=
" (" +
tr(
"diameter" ) +
")";
162 btnChangeColor->setAllowAlpha(
true );
163 btnChangeColor->setColorDialogTitle(
tr(
"Select line color" ) );
164 btnChangeColor->setContext(
"symbology" );
166 spinOffset->setClearValue( 0.0 );
171 mDrawInsideCheckBox->hide();
186 if ( !layer || layer->
layerType() !=
"SimpleLine" )
193 mPenWidthUnitWidget->blockSignals(
true );
196 mPenWidthUnitWidget->blockSignals(
false );
197 mOffsetUnitWidget->blockSignals(
true );
200 mOffsetUnitWidget->blockSignals(
false );
201 mDashPatternUnitWidget->blockSignals(
true );
205 mDashPatternUnitWidget->blockSignals(
false );
208 spinWidth->blockSignals(
true );
210 spinWidth->blockSignals(
false );
211 btnChangeColor->blockSignals(
true );
213 btnChangeColor->blockSignals(
false );
214 spinOffset->blockSignals(
true );
216 spinOffset->blockSignals(
false );
217 cboPenStyle->blockSignals(
true );
218 cboJoinStyle->blockSignals(
true );
219 cboCapStyle->blockSignals(
true );
223 cboPenStyle->blockSignals(
false );
224 cboJoinStyle->blockSignals(
false );
225 cboCapStyle->blockSignals(
false );
229 mChangePatternButton->setEnabled( useCustomDashPattern );
230 label_3->setEnabled( !useCustomDashPattern );
231 cboPenStyle->setEnabled( !useCustomDashPattern );
232 mCustomCheckBox->blockSignals(
true );
233 mCustomCheckBox->setCheckState( useCustomDashPattern ? Qt::Checked : Qt::Unchecked );
234 mCustomCheckBox->blockSignals(
false );
238 mDrawInsideCheckBox->blockSignals(
true );
239 mDrawInsideCheckBox->setCheckState( drawInsidePolygon ? Qt::Checked : Qt::Unchecked );
240 mDrawInsideCheckBox->blockSignals(
false );
289 bool checked = ( state == Qt::Checked );
290 mChangePatternButton->setEnabled( checked );
291 label_3->setEnabled( !checked );
292 cboPenStyle->setEnabled( !checked );
301 if ( d.exec() == QDialog::Accepted )
341 bool checked = ( state == Qt::Checked );
360 mChangePatternButton->setIcon( buttonIcon );
378 btnChangeColorFill->setAllowAlpha(
true );
379 btnChangeColorFill->setColorDialogTitle(
tr(
"Select fill color" ) );
380 btnChangeColorFill->setContext(
"symbology" );
381 btnChangeColorFill->setShowNoColor(
true );
382 btnChangeColorFill->setNoColorString(
tr(
"Transparent fill" ) );
383 btnChangeColorBorder->setAllowAlpha(
true );
384 btnChangeColorBorder->setColorDialogTitle(
tr(
"Select border color" ) );
385 btnChangeColorBorder->setContext(
"symbology" );
386 btnChangeColorBorder->setShowNoColor(
true );
387 btnChangeColorBorder->setNoColorString(
tr(
"Transparent border" ) );
389 spinOffsetX->setClearValue( 0.0 );
390 spinOffsetY->setClearValue( 0.0 );
400 names <<
"circle" <<
"rectangle" <<
"diamond" <<
"pentagon" <<
"cross" <<
"cross2" <<
"triangle"
401 <<
"equilateral_triangle" <<
"star" <<
"regular_star" <<
"arrow" <<
"line" <<
"arrowhead" <<
"filled_arrowhead";
403 for (
int i = 0; i < names.
count(); ++i )
408 item->
setData( Qt::UserRole, names[i] );
412 connect( lstNames, SIGNAL( currentRowChanged(
int ) ),
this, SLOT(
setName() ) );
415 connect( spinSize, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setSize() ) );
416 connect( spinAngle, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setAngle() ) );
417 connect( spinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
418 connect( spinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
419 connect(
this, SIGNAL(
changed() ),
this, SLOT( updateAssistantSymbol() ) );
424 delete mAssistantPreviewSymbol;
429 if ( layer->
layerType() !=
"SimpleMarker" )
437 for (
int i = 0; i < lstNames->count(); ++i )
439 if ( lstNames->item( i )->data( Qt::UserRole ).toString() ==
name )
441 lstNames->setCurrentRow( i );
445 btnChangeColorBorder->blockSignals(
true );
447 btnChangeColorBorder->blockSignals(
false );
448 btnChangeColorFill->blockSignals(
true );
450 btnChangeColorFill->blockSignals(
false );
451 spinSize->blockSignals(
true );
453 spinSize->blockSignals(
false );
454 spinAngle->blockSignals(
true );
456 spinAngle->blockSignals(
false );
457 mOutlineStyleComboBox->blockSignals(
true );
459 mOutlineStyleComboBox->blockSignals(
false );
460 mOutlineWidthSpinBox->blockSignals(
true );
462 mOutlineWidthSpinBox->blockSignals(
false );
465 spinOffsetX->blockSignals(
true );
467 spinOffsetX->blockSignals(
false );
468 spinOffsetY->blockSignals(
true );
470 spinOffsetY->blockSignals(
false );
472 mSizeUnitWidget->blockSignals(
true );
475 mSizeUnitWidget->blockSignals(
false );
476 mOffsetUnitWidget->blockSignals(
true );
479 mOffsetUnitWidget->blockSignals(
false );
480 mOutlineWidthUnitWidget->blockSignals(
true );
483 mOutlineWidthUnitWidget->blockSignals(
false );
486 mHorizontalAnchorComboBox->blockSignals(
true );
487 mVerticalAnchorComboBox->blockSignals(
true );
490 mHorizontalAnchorComboBox->blockSignals(
false );
491 mVerticalAnchorComboBox->blockSignals(
false );
494 "<b>pentagon</b>|<b>triangle</b>|<b>equilateral_triangle</b>|"
495 "<b>star</b>|<b>regular_star</b>|<b>arrow</b>|<b>filled_arrowhead</b>|"
496 "<b>circle</b>|<b>cross</b>|<b>x</b>|"
497 "<b>cross2</b>|<b>line</b>|<b>arrowhead</b>]" ) );
508 updateAssistantSymbol();
518 mLayer->
setName( lstNames->currentItem()->data( Qt::UserRole ).toString() );
620 void QgsSimpleMarkerSymbolLayerV2Widget::updateAssistantSymbol()
622 for (
int i = mAssistantPreviewSymbol->
symbolLayerCount() - 1 ; i >= 0; --i )
644 btnChangeColor->setAllowAlpha(
true );
645 btnChangeColor->setColorDialogTitle(
tr(
"Select fill color" ) );
646 btnChangeColor->setContext(
"symbology" );
647 btnChangeColor->setShowNoColor(
true );
648 btnChangeColor->setNoColorString(
tr(
"Transparent fill" ) );
649 btnChangeBorderColor->setAllowAlpha(
true );
650 btnChangeBorderColor->setColorDialogTitle(
tr(
"Select border color" ) );
651 btnChangeBorderColor->setContext(
"symbology" );
652 btnChangeBorderColor->setShowNoColor(
true );
653 btnChangeBorderColor->setNoColorString(
tr(
"Transparent border" ) );
655 spinOffsetX->setClearValue( 0.0 );
656 spinOffsetY->setClearValue( 0.0 );
670 if ( layer->
layerType() !=
"SimpleFill" )
677 btnChangeColor->blockSignals(
true );
679 btnChangeColor->blockSignals(
false );
680 cboFillStyle->blockSignals(
true );
682 cboFillStyle->blockSignals(
false );
683 btnChangeBorderColor->blockSignals(
true );
685 btnChangeBorderColor->blockSignals(
false );
686 cboBorderStyle->blockSignals(
true );
688 cboBorderStyle->blockSignals(
false );
689 spinBorderWidth->blockSignals(
true );
691 spinBorderWidth->blockSignals(
false );
692 cboJoinStyle->blockSignals(
true );
694 cboJoinStyle->blockSignals(
false );
695 spinOffsetX->blockSignals(
true );
697 spinOffsetX->blockSignals(
false );
698 spinOffsetY->blockSignals(
true );
700 spinOffsetY->blockSignals(
false );
702 mBorderWidthUnitWidget->blockSignals(
true );
705 mBorderWidthUnitWidget->blockSignals(
false );
706 mOffsetUnitWidget->blockSignals(
true );
709 mOffsetUnitWidget->blockSignals(
false );
792 cboGradientColorRamp->setShowGradientOnly(
true );
795 btnChangeColor->setAllowAlpha(
true );
796 btnChangeColor->setColorDialogTitle(
tr(
"Select gradient color" ) );
797 btnChangeColor->setContext(
"symbology" );
798 btnChangeColor->setShowNoColor(
true );
799 btnChangeColor->setNoColorString(
tr(
"Transparent" ) );
800 btnChangeColor2->setAllowAlpha(
true );
801 btnChangeColor2->setColorDialogTitle(
tr(
"Select gradient color" ) );
802 btnChangeColor2->setContext(
"symbology" );
803 btnChangeColor2->setShowNoColor(
true );
804 btnChangeColor2->setNoColorString(
tr(
"Transparent" ) );
806 spinOffsetX->setClearValue( 0.0 );
807 spinOffsetY->setClearValue( 0.0 );
811 connect( cboGradientColorRamp, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT(
applyColorRamp() ) );
813 connect( mButtonEditRamp, SIGNAL( clicked() ), cboGradientColorRamp, SLOT( editSourceRamp() ) );
830 if ( layer->
layerType() !=
"GradientFill" )
837 btnChangeColor->blockSignals(
true );
839 btnChangeColor->blockSignals(
false );
840 btnChangeColor2->blockSignals(
true );
842 btnChangeColor2->blockSignals(
false );
846 radioTwoColor->setChecked(
true );
847 cboGradientColorRamp->setEnabled(
false );
851 radioColorRamp->setChecked(
true );
852 btnChangeColor->setEnabled(
false );
853 btnChangeColor2->setEnabled(
false );
859 cboGradientColorRamp->blockSignals(
true );
861 cboGradientColorRamp->blockSignals(
false );
864 cboGradientType->blockSignals(
true );
868 cboGradientType->setCurrentIndex( 0 );
871 cboGradientType->setCurrentIndex( 1 );
874 cboGradientType->setCurrentIndex( 2 );
877 cboGradientType->blockSignals(
false );
879 cboCoordinateMode->blockSignals(
true );
883 cboCoordinateMode->setCurrentIndex( 1 );
884 checkRefPoint1Centroid->setEnabled(
false );
885 checkRefPoint2Centroid->setEnabled(
false );
889 cboCoordinateMode->setCurrentIndex( 0 );
892 cboCoordinateMode->blockSignals(
false );
894 cboGradientSpread->blockSignals(
true );
898 cboGradientSpread->setCurrentIndex( 0 );
901 cboGradientSpread->setCurrentIndex( 1 );
904 cboGradientSpread->setCurrentIndex( 2 );
907 cboGradientSpread->blockSignals(
false );
909 spinRefPoint1X->blockSignals(
true );
911 spinRefPoint1X->blockSignals(
false );
912 spinRefPoint1Y->blockSignals(
true );
914 spinRefPoint1Y->blockSignals(
false );
915 checkRefPoint1Centroid->blockSignals(
true );
919 spinRefPoint1X->setEnabled(
false );
920 spinRefPoint1Y->setEnabled(
false );
922 checkRefPoint1Centroid->blockSignals(
false );
923 spinRefPoint2X->blockSignals(
true );
925 spinRefPoint2X->blockSignals(
false );
926 spinRefPoint2Y->blockSignals(
true );
928 spinRefPoint2Y->blockSignals(
false );
929 checkRefPoint2Centroid->blockSignals(
true );
933 spinRefPoint2X->setEnabled(
false );
934 spinRefPoint2Y->setEnabled(
false );
936 checkRefPoint2Centroid->blockSignals(
false );
938 spinOffsetX->blockSignals(
true );
940 spinOffsetX->blockSignals(
false );
941 spinOffsetY->blockSignals(
true );
943 spinOffsetY->blockSignals(
false );
944 mSpinAngle->blockSignals(
true );
946 mSpinAngle->blockSignals(
false );
948 mOffsetUnitWidget->blockSignals(
true );
951 mOffsetUnitWidget->blockSignals(
false );
986 if ( radioTwoColor->isChecked() )
1014 spinRefPoint1X->setValue( 0.5 );
1015 spinRefPoint1Y->setValue( 0 );
1016 spinRefPoint2X->setValue( 0.5 );
1017 spinRefPoint2Y->setValue( 1 );
1022 spinRefPoint1X->setValue( 0 );
1023 spinRefPoint1Y->setValue( 0 );
1024 spinRefPoint2X->setValue( 1 );
1025 spinRefPoint2Y->setValue( 1 );
1029 spinRefPoint1X->setValue( 0.5 );
1030 spinRefPoint1Y->setValue( 0.5 );
1031 spinRefPoint2X->setValue( 1 );
1032 spinRefPoint2Y->setValue( 1 );
1047 checkRefPoint1Centroid->setEnabled(
true );
1048 checkRefPoint2Centroid->setEnabled(
true );
1054 checkRefPoint1Centroid->setChecked( Qt::Unchecked );
1055 checkRefPoint1Centroid->setEnabled(
false );
1056 checkRefPoint2Centroid->setChecked( Qt::Unchecked );
1057 checkRefPoint2Centroid->setEnabled(
false );
1124 btnChangeColor->setAllowAlpha(
true );
1125 btnChangeColor->setColorDialogTitle(
tr(
"Select gradient color" ) );
1126 btnChangeColor->setContext(
"symbology" );
1127 btnChangeColor->setShowNoColor(
true );
1128 btnChangeColor->setNoColorString(
tr(
"Transparent" ) );
1129 btnChangeColor2->setAllowAlpha(
true );
1130 btnChangeColor2->setColorDialogTitle(
tr(
"Select gradient color" ) );
1131 btnChangeColor2->setContext(
"symbology" );
1132 btnChangeColor2->setShowNoColor(
true );
1133 btnChangeColor2->setNoColorString(
tr(
"Transparent" ) );
1135 spinOffsetX->setClearValue( 0.0 );
1136 spinOffsetY->setClearValue( 0.0 );
1140 connect( cboGradientColorRamp, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT(
applyColorRamp() ) );
1142 connect( mButtonEditRamp, SIGNAL( clicked() ), cboGradientColorRamp, SLOT( editSourceRamp() ) );
1150 connect( mBlurSlider, SIGNAL( valueChanged(
int ) ), mSpinBlurRadius, SLOT( setValue(
int ) ) );
1151 connect( mSpinBlurRadius, SIGNAL( valueChanged(
int ) ), mBlurSlider, SLOT( setValue(
int ) ) );
1156 if ( layer->
layerType() !=
"ShapeburstFill" )
1163 btnChangeColor->blockSignals(
true );
1165 btnChangeColor->blockSignals(
false );
1166 btnChangeColor2->blockSignals(
true );
1168 btnChangeColor2->blockSignals(
false );
1172 radioTwoColor->setChecked(
true );
1173 cboGradientColorRamp->setEnabled(
false );
1177 radioColorRamp->setChecked(
true );
1178 btnChangeColor->setEnabled(
false );
1179 btnChangeColor2->setEnabled(
false );
1182 mSpinBlurRadius->blockSignals(
true );
1183 mBlurSlider->blockSignals(
true );
1186 mSpinBlurRadius->blockSignals(
false );
1187 mBlurSlider->blockSignals(
false );
1189 mSpinMaxDistance->blockSignals(
true );
1191 mSpinMaxDistance->blockSignals(
false );
1193 mRadioUseWholeShape->blockSignals(
true );
1194 mRadioUseMaxDistance->blockSignals(
true );
1197 mRadioUseWholeShape->setChecked(
true );
1198 mSpinMaxDistance->setEnabled(
false );
1199 mDistanceUnitWidget->setEnabled(
false );
1203 mRadioUseMaxDistance->setChecked(
true );
1204 mSpinMaxDistance->setEnabled(
true );
1205 mDistanceUnitWidget->setEnabled(
true );
1207 mRadioUseWholeShape->blockSignals(
false );
1208 mRadioUseMaxDistance->blockSignals(
false );
1210 mDistanceUnitWidget->blockSignals(
true );
1213 mDistanceUnitWidget->blockSignals(
false );
1215 mIgnoreRingsCheckBox->blockSignals(
true );
1216 mIgnoreRingsCheckBox->setCheckState(
mLayer->
ignoreRings() ? Qt::Checked : Qt::Unchecked );
1217 mIgnoreRingsCheckBox->blockSignals(
false );
1222 cboGradientColorRamp->blockSignals(
true );
1224 cboGradientColorRamp->blockSignals(
false );
1227 spinOffsetX->blockSignals(
true );
1229 spinOffsetX->blockSignals(
false );
1230 spinOffsetY->blockSignals(
true );
1232 spinOffsetY->blockSignals(
false );
1233 mOffsetUnitWidget->blockSignals(
true );
1236 mOffsetUnitWidget->blockSignals(
false );
1276 if ( radioTwoColor->isChecked() )
1320 mDistanceUnitWidget->setEnabled( !value );
1357 bool checked = ( state == Qt::Checked );
1374 spinOffset->setClearValue( 0.0 );
1376 connect( spinInterval, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setInterval(
double ) ) );
1378 connect( chkRotateMarker, SIGNAL( clicked() ),
this, SLOT(
setRotate() ) );
1379 connect( spinOffset, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
1390 if ( layer->
layerType() !=
"MarkerLine" )
1397 spinInterval->blockSignals(
true );
1399 spinInterval->blockSignals(
false );
1400 mSpinOffsetAlongLine->blockSignals(
true );
1402 mSpinOffsetAlongLine->blockSignals(
false );
1403 chkRotateMarker->blockSignals(
true );
1405 chkRotateMarker->blockSignals(
false );
1406 spinOffset->blockSignals(
true );
1408 spinOffset->blockSignals(
false );
1410 radInterval->setChecked(
true );
1412 radVertex->setChecked(
true );
1414 radVertexLast->setChecked(
true );
1416 radCentralPoint->setChecked(
true );
1418 radCurvePoint->setChecked(
true );
1420 radVertexFirst->setChecked(
true );
1423 mIntervalUnitWidget->blockSignals(
true );
1426 mIntervalUnitWidget->blockSignals(
false );
1427 mOffsetUnitWidget->blockSignals(
true );
1430 mOffsetUnitWidget->blockSignals(
false );
1431 mOffsetAlongLineUnitWidget->blockSignals(
true );
1434 mOffsetAlongLineUnitWidget->blockSignals(
false );
1475 bool interval = radInterval->isChecked();
1476 spinInterval->setEnabled( interval );
1477 mSpinOffsetAlongLine->setEnabled( radInterval->isChecked() || radVertexLast->isChecked() || radVertexFirst->isChecked() );
1479 if ( radInterval->isChecked() )
1481 else if ( radVertex->isChecked() )
1483 else if ( radVertexLast->isChecked() )
1485 else if ( radVertexFirst->isChecked() )
1487 else if ( radCurvePoint->isChecked() )
1537 viewGroups->setHeaderHidden(
true );
1539 mChangeColorButton->setColorDialogTitle(
tr(
"Select fill color" ) );
1540 mChangeColorButton->setContext(
"symbology" );
1541 mChangeBorderColorButton->setColorDialogTitle(
tr(
"Select border color" ) );
1542 mChangeColorButton->setContext(
"symbology" );
1544 spinOffsetX->setClearValue( 0.0 );
1545 spinOffsetY->setClearValue( 0.0 );
1551 connect( spinSize, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setSize() ) );
1552 connect( spinAngle, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setAngle() ) );
1553 connect( spinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
1554 connect( spinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
1555 connect(
this, SIGNAL(
changed() ),
this, SLOT( updateAssistantSymbol() ) );
1565 delete mAssistantPreviewSymbol;
1569 #include <QAbstractListModel>
1570 #include <QPixmapCache>
1597 if ( role == Qt::DecorationRole )
1604 double outlineWidth;
1605 bool fillParam, outlineParam, outlineWidthParam;
1606 bool hasDefaultFillColor =
false, hasDefaultOutlineColor =
false, hasDefaultOutlineWidth =
false;
1608 outlineParam, hasDefaultOutlineColor, outline,
1609 outlineWidthParam, hasDefaultOutlineWidth, outlineWidth );
1612 if ( !hasDefaultFillColor )
1613 fill =
QColor( 200, 200, 200 );
1614 if ( !hasDefaultOutlineColor )
1615 outline = Qt::black;
1616 if ( !hasDefaultOutlineWidth )
1627 else if ( role == Qt::UserRole || role == Qt::ToolTipRole )
1647 for (
int i = 0; i < svgPaths.
size(); i++ )
1649 QDir dir( svgPaths[i] );
1670 createTree( baseGroup );
1678 Q_FOREACH (
const QString&
item, parentDir.entryList( QDir::Dirs | QDir::NoDotAndDotDot ) )
1687 createTree( group );
1695 viewGroups->setModel( g );
1698 for (
int i = 0; i < rows; i++ )
1705 viewImages->setModel( m );
1713 viewImages->setModel( m );
1727 bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
1728 QColor defaultFill, defaultOutline;
1729 double defaultOutlineWidth;
1730 bool hasDefaultFillColor, hasDefaultOutlineColor, hasDefaultOutlineWidth;
1732 hasOutlineParam, hasDefaultOutlineColor, defaultOutline,
1733 hasOutlineWidthParam, hasDefaultOutlineWidth, defaultOutlineWidth );
1734 mChangeColorButton->setEnabled( hasFillParam );
1735 mChangeBorderColorButton->setEnabled( hasOutlineParam );
1736 mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );
1742 mChangeColorButton->setColor( layer->
fillColor() );
1744 else if ( hasDefaultFillColor )
1746 mChangeColorButton->setColor( defaultFill );
1749 if ( hasOutlineParam )
1753 mChangeBorderColorButton->setColor( layer->
outlineColor() );
1755 else if ( hasDefaultOutlineColor )
1757 mChangeBorderColorButton->setColor( defaultOutline );
1761 mFileLineEdit->blockSignals(
true );
1762 mFileLineEdit->setText( layer->
path() );
1763 mFileLineEdit->blockSignals(
false );
1765 mBorderWidthSpinBox->blockSignals(
true );
1766 mBorderWidthSpinBox->setValue( layer->
outlineWidth() );
1767 mBorderWidthSpinBox->blockSignals(
false );
1770 void QgsSvgMarkerSymbolLayerV2Widget::updateAssistantSymbol()
1772 for (
int i = mAssistantPreviewSymbol->
symbolLayerCount() - 1 ; i >= 0; --i )
1790 if ( layer->
layerType() !=
"SvgMarker" )
1800 for (
int i = 0; i < m->
rowCount(); i++ )
1805 selModel->
select( idx, QItemSelectionModel::SelectCurrent );
1812 spinSize->blockSignals(
true );
1814 spinSize->blockSignals(
false );
1815 spinAngle->blockSignals(
true );
1817 spinAngle->blockSignals(
false );
1820 spinOffsetX->blockSignals(
true );
1822 spinOffsetX->blockSignals(
false );
1823 spinOffsetY->blockSignals(
true );
1825 spinOffsetY->blockSignals(
false );
1827 mSizeUnitWidget->blockSignals(
true );
1830 mSizeUnitWidget->blockSignals(
false );
1831 mBorderWidthUnitWidget->blockSignals(
true );
1834 mBorderWidthUnitWidget->blockSignals(
false );
1835 mOffsetUnitWidget->blockSignals(
true );
1838 mOffsetUnitWidget->blockSignals(
false );
1841 mHorizontalAnchorComboBox->blockSignals(
true );
1842 mVerticalAnchorComboBox->blockSignals(
true );
1845 mHorizontalAnchorComboBox->blockSignals(
false );
1846 mVerticalAnchorComboBox->blockSignals(
false );
1860 updateAssistantSymbol();
1872 mFileLineEdit->setText( name );
1900 tr(
"Select SVG file" ),
1902 tr(
"SVG files" ) +
" (*.svg)" );
1904 if ( file.
isEmpty() || !fi.exists() )
1908 mFileLineEdit->setText( file );
1910 s.
setValue(
"/UI/lastSVGMarkerDir", fi.absolutePath() );
1927 if ( !
QFileInfo( mFileLineEdit->text() ).exists() )
1929 QUrl url( mFileLineEdit->text() );
1930 if ( !url.isValid() )
2031 mSvgTreeView->setHeaderHidden(
true );
2034 mChangeColorButton->setColorDialogTitle(
tr(
"Select fill color" ) );
2035 mChangeColorButton->setContext(
"symbology" );
2036 mChangeBorderColorButton->setColorDialogTitle(
tr(
"Select border color" ) );
2037 mChangeBorderColorButton->setContext(
"symbology" );
2059 mTextureWidthSpinBox->blockSignals(
true );
2060 mTextureWidthSpinBox->setValue( width );
2061 mTextureWidthSpinBox->blockSignals(
false );
2063 mRotationSpinBox->blockSignals(
true );
2065 mRotationSpinBox->blockSignals(
false );
2066 mTextureWidthUnitWidget->blockSignals(
true );
2069 mTextureWidthUnitWidget->blockSignals(
false );
2070 mSvgOutlineWidthUnitWidget->blockSignals(
true );
2073 mSvgOutlineWidthUnitWidget->blockSignals(
false );
2074 mChangeColorButton->blockSignals(
true );
2076 mChangeColorButton->blockSignals(
false );
2077 mChangeBorderColorButton->blockSignals(
true );
2079 mChangeBorderColorButton->blockSignals(
false );
2080 mBorderWidthSpinBox->blockSignals(
true );
2082 mBorderWidthSpinBox->blockSignals(
false );
2099 void QgsSVGFillSymbolLayerWidget::on_mBrowseToolButton_clicked()
2102 if ( !filePath.
isNull() )
2104 mSVGLineEdit->setText( filePath );
2109 void QgsSVGFillSymbolLayerWidget::on_mTextureWidthSpinBox_valueChanged(
double d )
2118 void QgsSVGFillSymbolLayerWidget::on_mSVGLineEdit_textEdited(
const QString & text )
2135 void QgsSVGFillSymbolLayerWidget::on_mSVGLineEdit_editingFinished()
2145 QUrl url( mSVGLineEdit->text() );
2146 if ( !url.isValid() )
2160 void QgsSVGFillSymbolLayerWidget::setFile(
const QModelIndex& item )
2164 mSVGLineEdit->setText( file );
2173 mSvgTreeView->setModel( g );
2176 for (
int i = 0; i < rows; i++ )
2182 mSvgListView->setModel( m );
2185 void QgsSVGFillSymbolLayerWidget::populateIcons(
const QModelIndex& idx )
2190 mSvgListView->setModel( m );
2197 void QgsSVGFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged(
double d )
2209 bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
2210 QColor defaultFill, defaultOutline;
2211 double defaultOutlineWidth;
2212 bool hasDefaultFillColor, hasDefaultOutlineColor, hasDefaultOutlineWidth;
2214 hasOutlineParam, hasDefaultOutlineColor, defaultOutline,
2215 hasOutlineWidthParam, hasDefaultOutlineWidth, defaultOutlineWidth );
2216 if ( hasDefaultFillColor && resetValues )
2218 mChangeColorButton->setColor( defaultFill );
2220 mChangeColorButton->setEnabled( hasFillParam );
2221 if ( hasDefaultOutlineColor && resetValues )
2223 mChangeBorderColorButton->setColor( defaultOutline );
2225 mChangeBorderColorButton->setEnabled( hasOutlineParam );
2226 if ( hasDefaultOutlineWidth && resetValues )
2228 mBorderWidthSpinBox->setValue( defaultOutlineWidth );
2230 mBorderWidthSpinBox->setEnabled( hasOutlineWidthParam );
2233 void QgsSVGFillSymbolLayerWidget::on_mChangeColorButton_colorChanged(
const QColor& color )
2244 void QgsSVGFillSymbolLayerWidget::on_mChangeBorderColorButton_colorChanged(
const QColor& color )
2255 void QgsSVGFillSymbolLayerWidget::on_mBorderWidthSpinBox_valueChanged(
double d )
2264 void QgsSVGFillSymbolLayerWidget::on_mTextureWidthUnitWidget_changed()
2274 void QgsSVGFillSymbolLayerWidget::on_mSvgOutlineWidthUnitWidget_changed()
2292 mOffsetSpinBox->setClearValue( 0 );
2297 if ( layer->
layerType() !=
"LinePatternFill" )
2306 mAngleSpinBox->blockSignals(
true );
2308 mAngleSpinBox->blockSignals(
false );
2309 mDistanceSpinBox->blockSignals(
true );
2311 mDistanceSpinBox->blockSignals(
false );
2312 mOffsetSpinBox->blockSignals(
true );
2314 mOffsetSpinBox->blockSignals(
false );
2317 mDistanceUnitWidget->blockSignals(
true );
2320 mDistanceUnitWidget->blockSignals(
false );
2321 mOffsetUnitWidget->blockSignals(
true );
2324 mOffsetUnitWidget->blockSignals(
false );
2336 void QgsLinePatternFillSymbolLayerWidget::on_mAngleSpinBox_valueChanged(
double d )
2345 void QgsLinePatternFillSymbolLayerWidget::on_mDistanceSpinBox_valueChanged(
double d )
2354 void QgsLinePatternFillSymbolLayerWidget::on_mOffsetSpinBox_valueChanged(
double d )
2363 void QgsLinePatternFillSymbolLayerWidget::on_mDistanceUnitWidget_changed()
2373 void QgsLinePatternFillSymbolLayerWidget::on_mOffsetUnitWidget_changed()
2398 if ( !layer || layer->
layerType() !=
"PointPatternFill" )
2404 mHorizontalDistanceSpinBox->blockSignals(
true );
2406 mHorizontalDistanceSpinBox->blockSignals(
false );
2407 mVerticalDistanceSpinBox->blockSignals(
true );
2409 mVerticalDistanceSpinBox->blockSignals(
false );
2410 mHorizontalDisplacementSpinBox->blockSignals(
true );
2412 mHorizontalDisplacementSpinBox->blockSignals(
false );
2413 mVerticalDisplacementSpinBox->blockSignals(
true );
2415 mVerticalDisplacementSpinBox->blockSignals(
false );
2417 mHorizontalDistanceUnitWidget->blockSignals(
true );
2420 mHorizontalDistanceUnitWidget->blockSignals(
false );
2421 mVerticalDistanceUnitWidget->blockSignals(
true );
2424 mVerticalDistanceUnitWidget->blockSignals(
false );
2425 mHorizontalDisplacementUnitWidget->blockSignals(
true );
2428 mHorizontalDisplacementUnitWidget->blockSignals(
false );
2429 mVerticalDisplacementUnitWidget->blockSignals(
true );
2432 mVerticalDisplacementUnitWidget->blockSignals(
false );
2445 void QgsPointPatternFillSymbolLayerWidget::on_mHorizontalDistanceSpinBox_valueChanged(
double d )
2454 void QgsPointPatternFillSymbolLayerWidget::on_mVerticalDistanceSpinBox_valueChanged(
double d )
2463 void QgsPointPatternFillSymbolLayerWidget::on_mHorizontalDisplacementSpinBox_valueChanged(
double d )
2472 void QgsPointPatternFillSymbolLayerWidget::on_mVerticalDisplacementSpinBox_valueChanged(
double d )
2481 void QgsPointPatternFillSymbolLayerWidget::on_mHorizontalDistanceUnitWidget_changed()
2491 void QgsPointPatternFillSymbolLayerWidget::on_mVerticalDistanceUnitWidget_changed()
2501 void QgsPointPatternFillSymbolLayerWidget::on_mHorizontalDisplacementUnitWidget_changed()
2511 void QgsPointPatternFillSymbolLayerWidget::on_mVerticalDisplacementUnitWidget_changed()
2534 btnColor->setAllowAlpha(
true );
2535 btnColor->setColorDialogTitle(
tr(
"Select symbol color" ) );
2536 btnColor->setContext(
"symbology" );
2538 spinOffsetX->setClearValue( 0.0 );
2539 spinOffsetY->setClearValue( 0.0 );
2548 connect( spinSize, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setSize(
double ) ) );
2550 connect( spinAngle, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setAngle(
double ) ) );
2551 connect( spinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
2552 connect( spinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT(
setOffset() ) );
2554 connect(
this, SIGNAL(
changed() ),
this, SLOT( updateAssistantSymbol() ) );
2559 delete mAssistantPreviewSymbol;
2564 if ( layer->
layerType() !=
"FontMarker" )
2572 cboFont->blockSignals(
true );
2573 cboFont->setCurrentFont( layerFont );
2574 cboFont->blockSignals(
false );
2575 spinSize->blockSignals(
true );
2577 spinSize->blockSignals(
false );
2578 btnColor->blockSignals(
true );
2580 btnColor->blockSignals(
false );
2581 spinAngle->blockSignals(
true );
2583 spinAngle->blockSignals(
false );
2591 spinOffsetX->blockSignals(
true );
2593 spinOffsetX->blockSignals(
false );
2594 spinOffsetY->blockSignals(
true );
2596 spinOffsetY->blockSignals(
false );
2598 mSizeUnitWidget->blockSignals(
true );
2601 mSizeUnitWidget->blockSignals(
false );
2603 mOffsetUnitWidget->blockSignals(
true );
2606 mOffsetUnitWidget->blockSignals(
false );
2609 mHorizontalAnchorComboBox->blockSignals(
true );
2610 mVerticalAnchorComboBox->blockSignals(
true );
2613 mHorizontalAnchorComboBox->blockSignals(
false );
2614 mVerticalAnchorComboBox->blockSignals(
false );
2624 updateAssistantSymbol();
2708 void QgsFontMarkerSymbolLayerV2Widget::updateAssistantSymbol()
2710 for (
int i = mAssistantPreviewSymbol->
symbolLayerCount() - 1 ; i >= 0; --i )
2733 if ( layer->
layerType() !=
"CentroidFill" )
2740 mDrawInsideCheckBox->blockSignals(
true );
2742 mDrawInsideCheckBox->blockSignals(
false );
2767 mSpinOffsetX->setClearValue( 0.0 );
2768 mSpinOffsetY->setClearValue( 0.0 );
2770 connect( cboCoordinateMode, SIGNAL( currentIndexChanged(
int ) ),
this, SLOT( setCoordinateMode(
int ) ) );
2771 connect( mSpinOffsetX, SIGNAL( valueChanged(
double ) ),
this, SLOT( offsetChanged() ) );
2772 connect( mSpinOffsetY, SIGNAL( valueChanged(
double ) ),
this, SLOT( offsetChanged() ) );
2782 if ( layer->
layerType() !=
"RasterFill" )
2793 mImageLineEdit->blockSignals(
true );
2795 mImageLineEdit->blockSignals(
false );
2797 cboCoordinateMode->blockSignals(
true );
2801 cboCoordinateMode->setCurrentIndex( 1 );
2805 cboCoordinateMode->setCurrentIndex( 0 );
2808 cboCoordinateMode->blockSignals(
false );
2809 mSpinTransparency->blockSignals(
true );
2810 mSpinTransparency->setValue(
mLayer->
alpha() * 100.0 );
2811 mSpinTransparency->blockSignals(
false );
2812 mSliderTransparency->blockSignals(
true );
2813 mSliderTransparency->setValue(
mLayer->
alpha() * 100.0 );
2814 mSliderTransparency->blockSignals(
false );
2815 mRotationSpinBox->blockSignals(
true );
2817 mRotationSpinBox->blockSignals(
false );
2819 mSpinOffsetX->blockSignals(
true );
2821 mSpinOffsetX->blockSignals(
false );
2822 mSpinOffsetY->blockSignals(
true );
2824 mSpinOffsetY->blockSignals(
false );
2825 mOffsetUnitWidget->blockSignals(
true );
2828 mOffsetUnitWidget->blockSignals(
false );
2830 mWidthSpinBox->blockSignals(
true );
2832 mWidthSpinBox->blockSignals(
false );
2833 mWidthUnitWidget->blockSignals(
true );
2836 mWidthUnitWidget->blockSignals(
false );
2837 updatePreviewImage();
2850 void QgsRasterFillSymbolLayerWidget::on_mBrowseToolButton_clicked()
2854 QString lineEditText = mImageLineEdit->text();
2855 if ( !lineEditText.
isEmpty() )
2857 QFileInfo openDirFileInfo( lineEditText );
2858 openDir = openDirFileInfo.path();
2863 openDir = s.
value(
"/UI/lastRasterFillImageDir",
"" ).
toString();
2868 if ( !filePath.
isNull() )
2872 if ( !fileInfo.exists() || !fileInfo.isReadable() )
2878 s.
setValue(
"/UI/lastRasterFillImageDir", fileInfo.absolutePath() );
2879 mImageLineEdit->setText( filePath );
2880 on_mImageLineEdit_editingFinished();
2884 void QgsRasterFillSymbolLayerWidget::on_mImageLineEdit_editingFinished()
2894 QUrl url( mImageLineEdit->text() );
2895 if ( !url.isValid() )
2903 updatePreviewImage();
2909 void QgsRasterFillSymbolLayerWidget::setCoordinateMode(
int index )
2926 void QgsRasterFillSymbolLayerWidget::on_mSpinTransparency_valueChanged(
int value )
2935 updatePreviewImage();
2938 void QgsRasterFillSymbolLayerWidget::offsetChanged()
2944 void QgsRasterFillSymbolLayerWidget::on_mOffsetUnitWidget_changed()
2955 void QgsRasterFillSymbolLayerWidget::on_mRotationSpinBox_valueChanged(
double d )
2964 void QgsRasterFillSymbolLayerWidget::on_mWidthUnitWidget_changed()
2975 void QgsRasterFillSymbolLayerWidget::on_mWidthSpinBox_valueChanged(
double d )
2986 void QgsRasterFillSymbolLayerWidget::updatePreviewImage()
2994 if ( image.isNull() )
2996 mLabelImagePreview->setPixmap(
QPixmap() );
3000 if ( image.height() > 150 || image.width() > 150 )
3002 image = image.
scaled( 150, 150, Qt::KeepAspectRatio, Qt::SmoothTransformation );
3005 QImage previewImage( 150, 150, QImage::Format_ARGB32 );
3006 previewImage.fill( Qt::transparent );
3007 QRect imageRect(( 150 - image.width() ) / 2.0, ( 150 - image.height() ) / 2.0, image.width(), image.height() );
3009 p.
begin( &previewImage );
3011 uchar pixDataRGB[] = { 150, 150, 150, 150,
3016 QImage img( pixDataRGB, 2, 2, 8, QImage::Format_ARGB32 );
3020 p.fillRect( imageRect, checkerBrush );
3027 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...
static const QString EXPR_ORIGINAL_VALUE
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
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.
static QIcon symbolLayerPreviewIcon(QgsSymbolLayerV2 *layer, QgsSymbolV2::OutputUnit u, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale())
QgsSvgListModel(QObject *parent, const QString &path)
void setCoordinateMode(GradientCoordinateMode coordinateMode)
virtual double width() const
int rowCount(const QModelIndex &parent=QModelIndex()) const override
QgsSymbolV2::OutputUnit distanceXUnit() const
static QString qgisSettingsDirPath()
Returns the path to the settings directory in user's home dir.
void setSvgFillColor(const QColor &c)
void setPatternWidthMapUnitScale(const QgsMapUnitScale &scale)
HorizontalAnchorPoint horizontalAnchorPoint() const
QgsSymbolV2::OutputUnit offsetUnit() const
void setDistanceYUnit(QgsSymbolV2::OutputUnit unit)
QStandardItem * invisibleRootItem() const
QString svgFilePath() const
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
const QgsMapUnitScale & customDashPatternMapUnitScale() const
static QgsExpressionContextScope * atlasScope(const QgsAtlasComposition *atlas)
Creates a new scope which contains variables and functions relating to a QgsAtlasComposition.
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...
The output shall be in pixels.
Calculate scale by the diameter.
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)
QVector< qreal > customDashVector() const
void setOutlineWidth(double w)
const QgsMapUnitScale & intervalMapUnitScale() const
void setPenJoinStyle(Qt::PenJoinStyle style)
bool referencePoint2IsCentroid() const
QgsSymbolLayerV2 * clone() const override
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
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 setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setSvgOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
static QStringList listSvgFilesAt(const QString &directory)
Return a list of svg files at the specified directory.
const QgsMapUnitScale & borderWidthMapUnitScale() const
void setMapUnitScale(const QgsMapUnitScale &scale) override
QString tr(const char *sourceText, const char *disambiguation, int n)
QgsSymbolLayerV2 * clone() const override
void setColorRamp(QgsVectorColorRampV2 *ramp)
Map canvas is a class for displaying all GIS data types on a canvas.
Qt::PenStyle penStyle() const
void setWidthUnit(QgsSymbolV2::OutputUnit unit)
void setPatternWidth(double width)
virtual void setData(const QVariant &value, int role)
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)
The QgsMapSettings class contains configuration for rendering of the map.
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.
The output shall be in millimeters.
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)
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context...
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
bool appendSymbolLayer(QgsSymbolLayerV2 *layer)
Append symbol layer at the end of the list Ownership will be transferred.
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 setFontFamily(const QString &family)
void setPath(const QString &path)
void setBlurRadius(int blurRadius)
Sets the blur radius, which controls the amount of blurring applied to the fill.
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.
const QgsMapUnitScale & offsetMapUnitScale() const
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
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.
void setFillColor(const QColor &color) override
Set fill color.
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)
The output shall be in map unitx.
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)
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.
Single scope for storing variables and functions for use within a QgsExpressionContext.
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
void setColor2(const QColor &color2)
Sets the color for the endpoint of the shapeburst fill.
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)
static QString pkgDataPath()
Returns the common root path of all application data directories.
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 setBorderColor(const QColor &borderColor)
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 setBorderColor(const QColor &color)
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
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object...
QColor color2() const
Color for endpoint of gradient, only used if the gradient color type is set to SimpleTwoColor.
QgsExpressionContextScope & expressionContextScope()
Returns a reference to the expression context scope for the map canvas.
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.
static QStringList svgPaths()
Returns the pathes to svg directories.
virtual void setColor(const QColor &color)
Placement placement() const
void setHighlightedVariables(const QStringList &variableNames)
Sets the list of variable names within the context intended to be highlighted to the user...
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 setMapUnitScale(const QgsMapUnitScale &scale) override
Calculate scale by the area.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setColor2(const QColor &color2)
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
static QgsExpressionContextScope * projectScope()
Creates a new scope which contains variables and functions relating to the current QGIS project...
QgsSymbolV2::OutputUnit widthUnit() const
Returns the units for the image's width.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
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].
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
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 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)
void setName(const QString &name)
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 setBorderStyle(Qt::PenStyle borderStyle)