Lines Matching refs:mStyle

71     QgsStyle *mStyle = nullptr;  member in TestStyle
138 mStyle = new QgsStyle(); in initTestCase()
139 mStyle->createMemoryDatabase(); in initTestCase()
154 delete mStyle; in cleanupTestCase()
225 QVERIFY( mStyle->addColorRamp( "test_gradient", gradientRamp, true ) ); in testCreateColorRamps()
229 QVERIFY( mStyle->addColorRamp( "test_random", randomRamp, true ) ); in testCreateColorRamps()
233 QVERIFY( mStyle->addColorRamp( "test_cb1", cb1Ramp, true ) ); in testCreateColorRamps()
235 QVERIFY( mStyle->addColorRamp( "test_cb2", cb2Ramp, true ) ); in testCreateColorRamps()
239 QVERIFY( mStyle->addColorRamp( "test_cc1", cc1Ramp, true ) ); in testCreateColorRamps()
242 QVERIFY( mStyle->addColorRamp( "test_cc2", cc2Ramp, true ) ); in testCreateColorRamps()
245 QVERIFY( mStyle->addColorRamp( "test_cc3", cc3Ramp, true ) ); in testCreateColorRamps()
247 …QCOMPARE( mStyle->allNames( QgsStyle::ColorrampEntity ), QStringList() << QStringLiteral( "test_cb… in testCreateColorRamps()
257 QVERIFY( mStyle->addEntity( "test_cc4", &entity, true ) ); in testCreateColorRamps()
259 …QCOMPARE( mStyle->allNames( QgsStyle::ColorrampEntity ), QStringList() << QStringLiteral( "test_cb… in testCreateColorRamps()
271 QVERIFY( mStyle->textFormatNames().isEmpty() ); in testCreateTextFormats()
272 QCOMPARE( mStyle->textFormatCount(), 0 ); in testCreateTextFormats()
274 QCOMPARE( mStyle->textFormat( QString( "blah" ) ).color().name(), QStringLiteral( "#000000" ) ); in testCreateTextFormats()
276 QSignalSpy spy( mStyle, &QgsStyle::textFormatAdded ); in testCreateTextFormats()
277 QSignalSpy spyChanged( mStyle, &QgsStyle::textFormatChanged ); in testCreateTextFormats()
281 QVERIFY( mStyle->addTextFormat( "test_format", format, true ) ); in testCreateTextFormats()
285 QVERIFY( mStyle->textFormatNames().contains( QStringLiteral( "test_format" ) ) ); in testCreateTextFormats()
286 QCOMPARE( mStyle->textFormatCount(), 1 ); in testCreateTextFormats()
287 …QCOMPARE( mStyle->textFormat( QString( "test_format" ) ).color().name(), QStringLiteral( "#ff0000"… in testCreateTextFormats()
290 QVERIFY( mStyle->addTextFormat( "test_format", format, true ) ); in testCreateTextFormats()
291 QVERIFY( mStyle->textFormatNames().contains( QStringLiteral( "test_format" ) ) ); in testCreateTextFormats()
292 QCOMPARE( mStyle->textFormatCount(), 1 ); in testCreateTextFormats()
293 …QCOMPARE( mStyle->textFormat( QString( "test_format" ) ).color().name(), QStringLiteral( "#ffff00"… in testCreateTextFormats()
298 QVERIFY( mStyle->addTextFormat( "test_format2", format, true ) ); in testCreateTextFormats()
299 QVERIFY( mStyle->textFormatNames().contains( QStringLiteral( "test_format2" ) ) ); in testCreateTextFormats()
300 QCOMPARE( mStyle->textFormatCount(), 2 ); in testCreateTextFormats()
301 …QCOMPARE( mStyle->textFormat( QString( "test_format" ) ).color().name(), QStringLiteral( "#ffff00"… in testCreateTextFormats()
302 …QCOMPARE( mStyle->textFormat( QString( "test_format2" ) ).color().name(), QStringLiteral( "#ffffff… in testCreateTextFormats()
307 QVERIFY( mStyle->exportXml( QDir::tempPath() + "/text_style.xml" ) ); in testCreateTextFormats()
318 …QCOMPARE( mStyle->allNames( QgsStyle::TextFormatEntity ), QStringList() << QStringLiteral( "test_f… in testCreateTextFormats()
324 QVERIFY( mStyle->addEntity( "test_format4", &entity, true ) ); in testCreateTextFormats()
325 QVERIFY( mStyle->textFormatNames().contains( QStringLiteral( "test_format4" ) ) ); in testCreateTextFormats()
330 QVERIFY( mStyle->labelSettingsNames().isEmpty() ); in testCreateLabelSettings()
331 QCOMPARE( mStyle->labelSettingsCount(), 0 ); in testCreateLabelSettings()
333 QVERIFY( mStyle->labelSettings( QString( "blah" ) ).fieldName.isEmpty() ); in testCreateLabelSettings()
335 QSignalSpy spy( mStyle, &QgsStyle::labelSettingsAdded ); in testCreateLabelSettings()
336 QSignalSpy spyChanged( mStyle, &QgsStyle::labelSettingsChanged ); in testCreateLabelSettings()
340 QVERIFY( mStyle->addLabelSettings( "test_settings", settings, true ) ); in testCreateLabelSettings()
344 QVERIFY( mStyle->labelSettingsNames().contains( QStringLiteral( "test_settings" ) ) ); in testCreateLabelSettings()
345 QCOMPARE( mStyle->labelSettingsCount(), 1 ); in testCreateLabelSettings()
346 …QCOMPARE( mStyle->labelSettings( QString( "test_settings" ) ).fieldName, QStringLiteral( "a_field_… in testCreateLabelSettings()
349 QVERIFY( mStyle->addLabelSettings( "test_settings", settings, true ) ); in testCreateLabelSettings()
350 QVERIFY( mStyle->labelSettingsNames().contains( QStringLiteral( "test_settings" ) ) ); in testCreateLabelSettings()
351 QCOMPARE( mStyle->labelSettingsCount(), 1 ); in testCreateLabelSettings()
352 …QCOMPARE( mStyle->labelSettings( QString( "test_settings" ) ).fieldName, QStringLiteral( "actually… in testCreateLabelSettings()
357 QVERIFY( mStyle->addLabelSettings( "test_format2", settings, true ) ); in testCreateLabelSettings()
358 QVERIFY( mStyle->labelSettingsNames().contains( QStringLiteral( "test_format2" ) ) ); in testCreateLabelSettings()
359 QCOMPARE( mStyle->labelSettingsCount(), 2 ); in testCreateLabelSettings()
360 …QCOMPARE( mStyle->labelSettings( QString( "test_settings" ) ).fieldName, QStringLiteral( "actually… in testCreateLabelSettings()
361 …QCOMPARE( mStyle->labelSettings( QString( "test_format2" ) ).fieldName, QStringLiteral( "phew_it_w… in testCreateLabelSettings()
366 QVERIFY( mStyle->exportXml( QDir::tempPath() + "/text_style.xml" ) ); in testCreateLabelSettings()
377 …QCOMPARE( mStyle->allNames( QgsStyle::LabelSettingsEntity ), QStringList() << QStringLiteral( "tes… in testCreateLabelSettings()
381 QVERIFY( mStyle->addEntity( "test_settings2", &entity, true ) ); in testCreateLabelSettings()
382 QVERIFY( mStyle->labelSettingsNames().contains( QStringLiteral( "test_settings2" ) ) ); in testCreateLabelSettings()
387 QVERIFY( mStyle->legendPatchShapeNames().isEmpty() ); in testCreateLegendPatchShapes()
388 QCOMPARE( mStyle->legendPatchShapesCount(), 0 ); in testCreateLegendPatchShapes()
390 QVERIFY( mStyle->legendPatchShape( QString( "blah" ) ).isNull() ); in testCreateLegendPatchShapes()
392 QSignalSpy spy( mStyle, &QgsStyle::entityAdded ); in testCreateLegendPatchShapes()
393 QSignalSpy spyChanged( mStyle, &QgsStyle::entityChanged ); in testCreateLegendPatchShapes()
397 QVERIFY( mStyle->addLegendPatchShape( "test_settings", settings, true ) ); in testCreateLegendPatchShapes()
401 QVERIFY( mStyle->legendPatchShapeNames().contains( QStringLiteral( "test_settings" ) ) ); in testCreateLegendPatchShapes()
402 QCOMPARE( mStyle->legendPatchShapesCount(), 1 ); in testCreateLegendPatchShapes()
403 …QCOMPARE( mStyle->legendPatchShape( QString( "test_settings" ) ).geometry().asWkt(), QStringLitera… in testCreateLegendPatchShapes()
406 QVERIFY( mStyle->addLegendPatchShape( "test_settings", settings, true ) ); in testCreateLegendPatchShapes()
407 QVERIFY( mStyle->legendPatchShapeNames().contains( QStringLiteral( "test_settings" ) ) ); in testCreateLegendPatchShapes()
408 QCOMPARE( mStyle->legendPatchShapesCount(), 1 ); in testCreateLegendPatchShapes()
409 …QCOMPARE( mStyle->legendPatchShape( QString( "test_settings" ) ).geometry().asWkt(), QStringLitera… in testCreateLegendPatchShapes()
414 QVERIFY( mStyle->addLegendPatchShape( "test_format2", settings, true ) ); in testCreateLegendPatchShapes()
415 QVERIFY( mStyle->legendPatchShapeNames().contains( QStringLiteral( "test_format2" ) ) ); in testCreateLegendPatchShapes()
416 QCOMPARE( mStyle->legendPatchShapesCount(), 2 ); in testCreateLegendPatchShapes()
417 …QCOMPARE( mStyle->legendPatchShape( QString( "test_settings" ) ).geometry().asWkt(), QStringLitera… in testCreateLegendPatchShapes()
418 …QCOMPARE( mStyle->legendPatchShape( QString( "test_format2" ) ).geometry().asWkt(), QStringLiteral… in testCreateLegendPatchShapes()
423 QVERIFY( mStyle->exportXml( QDir::tempPath() + "/text_style.xml" ) ); in testCreateLegendPatchShapes()
434 …QCOMPARE( mStyle->allNames( QgsStyle::LegendPatchShapeEntity ), QStringList() << QStringLiteral( "… in testCreateLegendPatchShapes()
438 QVERIFY( mStyle->addEntity( "test_settings2", &entity, true ) ); in testCreateLegendPatchShapes()
439 QVERIFY( mStyle->legendPatchShapeNames().contains( QStringLiteral( "test_settings2" ) ) ); in testCreateLegendPatchShapes()
444 QVERIFY( mStyle->symbol3DNames().isEmpty() ); in testCreate3dSymbol()
445 QCOMPARE( mStyle->symbol3DCount(), 0 ); in testCreate3dSymbol()
447 QVERIFY( !mStyle->symbol3D( QString( "blah" ) ) ); in testCreate3dSymbol()
448 QVERIFY( mStyle->symbol3DCompatibleGeometryTypes( QStringLiteral( "blah" ) ).isEmpty() ); in testCreate3dSymbol()
450 QSignalSpy spy( mStyle, &QgsStyle::entityAdded ); in testCreate3dSymbol()
451 QSignalSpy spyChanged( mStyle, &QgsStyle::entityChanged ); in testCreate3dSymbol()
455 QVERIFY( mStyle->addSymbol3D( "test_settings", symbol.clone(), true ) ); in testCreate3dSymbol()
459 QVERIFY( mStyle->symbol3DNames().contains( QStringLiteral( "test_settings" ) ) ); in testCreate3dSymbol()
460 QCOMPARE( mStyle->symbol3DCount(), 1 ); in testCreate3dSymbol()
461 QVERIFY( mStyle->symbol3DCompatibleGeometryTypes( QStringLiteral( "blah" ) ).isEmpty() ); in testCreate3dSymbol()
462 …QCOMPARE( mStyle->symbol3DCompatibleGeometryTypes( QStringLiteral( "test_settings" ) ), QList< Qgs… in testCreate3dSymbol()
463 …std::unique_ptr< Dummy3DSymbol > retrieved( dynamic_cast< Dummy3DSymbol * >( mStyle->symbol3D( QSt… in testCreate3dSymbol()
466 QVERIFY( mStyle->addSymbol3D( "test_settings", symbol.clone(), true ) ); in testCreate3dSymbol()
467 QVERIFY( mStyle->symbol3DNames().contains( QStringLiteral( "test_settings" ) ) ); in testCreate3dSymbol()
468 QCOMPARE( mStyle->symbol3DCount(), 1 ); in testCreate3dSymbol()
469 …retrieved.reset( dynamic_cast< Dummy3DSymbol * >( mStyle->symbol3D( QStringLiteral( "test_settings… in testCreate3dSymbol()
475 QVERIFY( mStyle->addSymbol3D( "test_format2", symbol.clone(), true ) ); in testCreate3dSymbol()
476 QVERIFY( mStyle->symbol3DNames().contains( QStringLiteral( "test_format2" ) ) ); in testCreate3dSymbol()
477 QCOMPARE( mStyle->symbol3DCount(), 2 ); in testCreate3dSymbol()
478 …retrieved.reset( dynamic_cast< Dummy3DSymbol * >( mStyle->symbol3D( QStringLiteral( "test_settings… in testCreate3dSymbol()
480 …retrieved.reset( dynamic_cast< Dummy3DSymbol * >( mStyle->symbol3D( QStringLiteral( "test_format2"… in testCreate3dSymbol()
486 QVERIFY( mStyle->exportXml( QDir::tempPath() + "/text_style.xml" ) ); in testCreate3dSymbol()
499 …QCOMPARE( mStyle->allNames( QgsStyle::Symbol3DEntity ), QStringList() << QStringLiteral( "test_for… in testCreate3dSymbol()
503 QVERIFY( mStyle->addEntity( "test_settings2", &entity, true ) ); in testCreate3dSymbol()
504 QVERIFY( mStyle->symbol3DNames().contains( QStringLiteral( "test_settings2" ) ) ); in testCreate3dSymbol()
509 QStringList colorRamps = mStyle->colorRampNames(); in testLoadColorRamps()
540 QgsColorRamp *ramp = mStyle->colorRamp( name ); in testLoadColorRamps()
559 QStringList colorRamps = mStyle->colorRampNames(); in testSaveLoad()
568 QgsColorRamp *ramp = mStyle->colorRamp( name ); in testSaveLoad()
581 favorites = mStyle->symbolsOfFavorite( QgsStyle::SymbolEntity ); in testFavorites()
584 QVERIFY( !mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "AaaaaaaaaA" ) ) ); in testFavorites()
585 QVERIFY( !mStyle->isFavorite( QgsStyle::TextFormatEntity, QStringLiteral( "AaaaaaaaaA" ) ) ); in testFavorites()
586 QVERIFY( !mStyle->isFavorite( QgsStyle::LabelSettingsEntity, QStringLiteral( "AaaaaaaaaA" ) ) ); in testFavorites()
587 QVERIFY( !mStyle->isFavorite( QgsStyle::ColorrampEntity, QStringLiteral( "AaaaaaaaaA" ) ) ); in testFavorites()
588 …QVERIFY( !mStyle->isFavorite( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "AaaaaaaaaA" ) ) ); in testFavorites()
589 QVERIFY( !mStyle->isFavorite( QgsStyle::Symbol3DEntity, QStringLiteral( "AaaaaaaaaA" ) ) ); in testFavorites()
595 mStyle->saveSymbol( QStringLiteral( "symbolA" ), sym1.get(), true, QStringList() ); in testFavorites()
596 mStyle->saveSymbol( QStringLiteral( "symbolB" ), sym2.get(), false, QStringList() ); in testFavorites()
597 mStyle->saveSymbol( QStringLiteral( "symbolC" ), sym3.get(), true, QStringList() ); in testFavorites()
599 QVERIFY( mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolA" ) ) ); in testFavorites()
600 QVERIFY( !mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolB" ) ) ); in testFavorites()
601 QVERIFY( mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolC" ) ) ); in testFavorites()
604 favorites = mStyle->symbolsOfFavorite( QgsStyle::SymbolEntity ); in testFavorites()
609 QSignalSpy favoriteChangedSpy( mStyle, &QgsStyle::favoritedChanged ); in testFavorites()
612 mStyle->removeFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolA" ) ); in testFavorites()
618 QVERIFY( !mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolA" ) ) ); in testFavorites()
619 QVERIFY( !mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolB" ) ) ); in testFavorites()
620 QVERIFY( mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolC" ) ) ); in testFavorites()
623 favorites = mStyle->symbolsOfFavorite( QgsStyle::SymbolEntity ); in testFavorites()
627 mStyle->addFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolA" ) ); in testFavorites()
632 favorites = mStyle->symbolsOfFavorite( QgsStyle::SymbolEntity ); in testFavorites()
636 QVERIFY( mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolA" ) ) ); in testFavorites()
637 QVERIFY( !mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolB" ) ) ); in testFavorites()
638 QVERIFY( mStyle->isFavorite( QgsStyle::SymbolEntity, QStringLiteral( "symbolC" ) ) ); in testFavorites()
641 QVERIFY( mStyle->addColorRamp( "gradient_1", gradientRamp, true ) ); in testFavorites()
642 favorites = mStyle->symbolsOfFavorite( QgsStyle::ColorrampEntity ); in testFavorites()
645 QVERIFY( !mStyle->isFavorite( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_1" ) ) ); in testFavorites()
647 mStyle->addFavorite( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_1" ) ); in testFavorites()
652 favorites = mStyle->symbolsOfFavorite( QgsStyle::ColorrampEntity ); in testFavorites()
655 QVERIFY( mStyle->isFavorite( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_1" ) ) ); in testFavorites()
657 mStyle->removeFavorite( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_1" ) ); in testFavorites()
662 favorites = mStyle->symbolsOfFavorite( QgsStyle::ColorrampEntity ); in testFavorites()
664 QVERIFY( !mStyle->isFavorite( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_1" ) ) ); in testFavorites()
668 QVERIFY( mStyle->addTextFormat( QStringLiteral( "format_1" ), format1, true ) ); in testFavorites()
669 favorites = mStyle->symbolsOfFavorite( QgsStyle::TextFormatEntity ); in testFavorites()
671 QVERIFY( !mStyle->isFavorite( QgsStyle::TextFormatEntity, QStringLiteral( "format_1" ) ) ); in testFavorites()
673 mStyle->addFavorite( QgsStyle::TextFormatEntity, QStringLiteral( "format_1" ) ); in testFavorites()
678 favorites = mStyle->symbolsOfFavorite( QgsStyle::TextFormatEntity ); in testFavorites()
681 QVERIFY( mStyle->isFavorite( QgsStyle::TextFormatEntity, QStringLiteral( "format_1" ) ) ); in testFavorites()
683 mStyle->removeFavorite( QgsStyle::TextFormatEntity, QStringLiteral( "format_1" ) ); in testFavorites()
688 favorites = mStyle->symbolsOfFavorite( QgsStyle::TextFormatEntity ); in testFavorites()
690 QVERIFY( !mStyle->isFavorite( QgsStyle::TextFormatEntity, QStringLiteral( "format_1" ) ) ); in testFavorites()
694 QVERIFY( mStyle->addLabelSettings( QStringLiteral( "settings_1" ), settings1, true ) ); in testFavorites()
695 favorites = mStyle->symbolsOfFavorite( QgsStyle::LabelSettingsEntity ); in testFavorites()
697 QVERIFY( !mStyle->isFavorite( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings_1" ) ) ); in testFavorites()
699 mStyle->addFavorite( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings_1" ) ); in testFavorites()
704 favorites = mStyle->symbolsOfFavorite( QgsStyle::LabelSettingsEntity ); in testFavorites()
707 QVERIFY( mStyle->isFavorite( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings_1" ) ) ); in testFavorites()
709 mStyle->removeFavorite( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings_1" ) ); in testFavorites()
714 favorites = mStyle->symbolsOfFavorite( QgsStyle::LabelSettingsEntity ); in testFavorites()
716 QVERIFY( !mStyle->isFavorite( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings_1" ) ) ); in testFavorites()
720 QVERIFY( mStyle->addLegendPatchShape( QStringLiteral( "settings_1" ), shape1, true ) ); in testFavorites()
721 favorites = mStyle->symbolsOfFavorite( QgsStyle::LegendPatchShapeEntity ); in testFavorites()
723 …QVERIFY( !mStyle->isFavorite( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "settings_1" ) ) ); in testFavorites()
725 mStyle->addFavorite( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "settings_1" ) ); in testFavorites()
730 favorites = mStyle->symbolsOfFavorite( QgsStyle::LegendPatchShapeEntity ); in testFavorites()
733 QVERIFY( mStyle->isFavorite( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "settings_1" ) ) ); in testFavorites()
735 mStyle->removeFavorite( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "settings_1" ) ); in testFavorites()
740 favorites = mStyle->symbolsOfFavorite( QgsStyle::LegendPatchShapeEntity ); in testFavorites()
742 …QVERIFY( !mStyle->isFavorite( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "settings_1" ) ) ); in testFavorites()
746 QVERIFY( mStyle->addSymbol3D( QStringLiteral( "settings_1" ), symbol3d1.clone(), true ) ); in testFavorites()
747 favorites = mStyle->symbolsOfFavorite( QgsStyle::Symbol3DEntity ); in testFavorites()
749 QVERIFY( !mStyle->isFavorite( QgsStyle::Symbol3DEntity, QStringLiteral( "settings_1" ) ) ); in testFavorites()
751 mStyle->addFavorite( QgsStyle::Symbol3DEntity, QStringLiteral( "settings_1" ) ); in testFavorites()
756 favorites = mStyle->symbolsOfFavorite( QgsStyle::Symbol3DEntity ); in testFavorites()
759 QVERIFY( mStyle->isFavorite( QgsStyle::Symbol3DEntity, QStringLiteral( "settings_1" ) ) ); in testFavorites()
761 mStyle->removeFavorite( QgsStyle::Symbol3DEntity, QStringLiteral( "settings_1" ) ); in testFavorites()
766 favorites = mStyle->symbolsOfFavorite( QgsStyle::Symbol3DEntity ); in testFavorites()
768 QVERIFY( !mStyle->isFavorite( QgsStyle::Symbol3DEntity, QStringLiteral( "settings_1" ) ) ); in testFavorites()
774 int id = mStyle->addTag( QStringLiteral( "red" ) ); in testTags()
775 QCOMPARE( id, mStyle->tagId( "red" ) ); in testTags()
777 id = mStyle->addTag( QStringLiteral( "starry" ) ); in testTags()
778 QCOMPARE( id, mStyle->tagId( "starry" ) ); in testTags()
779 id = mStyle->addTag( QStringLiteral( "circle" ) ); in testTags()
780 QCOMPARE( id, mStyle->tagId( "circle" ) ); in testTags()
781 id = mStyle->addTag( QStringLiteral( "blue" ) ); in testTags()
782 QCOMPARE( id, mStyle->tagId( "blue" ) ); in testTags()
783 id = mStyle->addTag( QStringLiteral( "purple" ) ); in testTags()
786 QCOMPARE( id, mStyle->tagId( "purple" ) ); in testTags()
787 QCOMPARE( QStringLiteral( "purple" ), mStyle->tag( id ) ); in testTags()
789 QCOMPARE( mStyle->allNames( QgsStyle::TagEntity ), in testTags()
797 id = mStyle->addTag( QStringLiteral( "МЕТЕОР" ) ); in testTags()
798 QCOMPARE( id, mStyle->tagId( "МЕТЕОР" ) ); in testTags()
800 QStringList tags = mStyle->tags(); in testTags()
810 mStyle->remove( QgsStyle::TagEntity, mStyle->tagId( QStringLiteral( "purple" ) ) ); in testTags()
811 mStyle->remove( QgsStyle::TagEntity, -999 ); //bad id in testTags()
812 tags = mStyle->tags(); in testTags()
821 QVERIFY( mStyle->saveSymbol( "symbol1", sym1.get(), false, QStringList() << "red" << "starry" ) ); in testTags()
822 mStyle->addSymbol( QStringLiteral( "blue starry" ), sym2.release(), true ); in testTags()
823 mStyle->addSymbol( QStringLiteral( "red circle" ), sym3.release(), true ); in testTags()
824 mStyle->addSymbol( QStringLiteral( "МЕТЕОР" ), sym4.release(), true ); in testTags()
826 QSignalSpy tagsChangedSpy( mStyle, &QgsStyle::entityTagsChanged ); in testTags()
829 …QVERIFY( mStyle->tagSymbol( QgsStyle::SymbolEntity, "blue starry", QStringList() << "blue" << "sta… in testTags()
835 …QVERIFY( mStyle->tagSymbol( QgsStyle::SymbolEntity, "red circle", QStringList() << "red" << "circl… in testTags()
842 …QVERIFY( !mStyle->tagSymbol( QgsStyle::SymbolEntity, "no symbol", QStringList() << "red" << "circl… in testTags()
845 QVERIFY( mStyle->tagSymbol( QgsStyle::SymbolEntity, "red circle", QStringList() << "round" ) ); in testTags()
851 tags = mStyle->tags(); in testTags()
856 QVERIFY( mStyle->tagSymbol( QgsStyle::SymbolEntity, "МЕТЕОР", QStringList() << "МЕТЕОР" ) ); in testTags()
857 tags = mStyle->tags(); in testTags()
862 tags = mStyle->tagsOfSymbol( QgsStyle::SymbolEntity, QStringLiteral( "blue starry" ) ); in testTags()
866 tags = mStyle->tagsOfSymbol( QgsStyle::SymbolEntity, QStringLiteral( "red circle" ) ); in testTags()
871 tags = mStyle->tagsOfSymbol( QgsStyle::SymbolEntity, QStringLiteral( "symbol1" ) ); in testTags()
876 tags = mStyle->tagsOfSymbol( QgsStyle::SymbolEntity, QStringLiteral( "МЕТЕОР" ) ); in testTags()
881 …QVERIFY( mStyle->symbolHasTag( QgsStyle::SymbolEntity, QStringLiteral( "blue starry" ), QStringLit… in testTags()
882 …QVERIFY( mStyle->symbolHasTag( QgsStyle::SymbolEntity, QStringLiteral( "МЕТЕОР" ), QStringLiteral(… in testTags()
885 …QCOMPARE( false, mStyle->symbolHasTag( QgsStyle::SymbolEntity, QStringLiteral( "blue starry" ), QS… in testTags()
888 …QVERIFY( mStyle->detagSymbol( QgsStyle::SymbolEntity, "blue starry", QStringList() << "bad" << "bl… in testTags()
889 tags = mStyle->tagsOfSymbol( QgsStyle::SymbolEntity, QStringLiteral( "blue starry" ) ); in testTags()
898 QVERIFY( mStyle->detagSymbol( QgsStyle::SymbolEntity, QStringLiteral( "blue starry" ) ) ); in testTags()
899 tags = mStyle->tagsOfSymbol( QgsStyle::SymbolEntity, QStringLiteral( "blue starry" ) ); in testTags()
907 …QVERIFY( !mStyle->detagSymbol( QgsStyle::SymbolEntity, "no symbol!", QStringList() << "bad" << "bl… in testTags()
910mStyle->tagSymbol( QgsStyle::SymbolEntity, "blue starry", QStringList() << QStringLiteral( "starry… in testTags()
913 …QStringList symbols = mStyle->symbolsWithTag( QgsStyle::SymbolEntity, mStyle->tagId( QStringLitera… in testTags()
917 …symbols = mStyle->symbolsWithTag( QgsStyle::SymbolEntity, mStyle->tagId( QStringLiteral( "starry" … in testTags()
921 …symbols = mStyle->symbolsWithTag( QgsStyle::SymbolEntity, mStyle->tagId( QStringLiteral( "circle" … in testTags()
924 …symbols = mStyle->symbolsWithTag( QgsStyle::SymbolEntity, mStyle->tagId( QStringLiteral( "round" )… in testTags()
926 …symbols = mStyle->symbolsWithTag( QgsStyle::SymbolEntity, mStyle->tagId( QStringLiteral( "МЕТЕОР" … in testTags()
929 …symbols = mStyle->symbolsWithTag( QgsStyle::SymbolEntity, mStyle->tagId( QStringLiteral( "blue" ) … in testTags()
931 …symbols = mStyle->symbolsWithTag( QgsStyle::SymbolEntity, mStyle->tagId( QStringLiteral( "no tag" … in testTags()
935 symbols = mStyle->findSymbols( QgsStyle::SymbolEntity, QStringLiteral( "red" ) ); in testTags()
939 symbols = mStyle->findSymbols( QgsStyle::SymbolEntity, QStringLiteral( "symbol1" ) ); in testTags()
942 symbols = mStyle->findSymbols( QgsStyle::SymbolEntity, QStringLiteral( "starry" ) ); in testTags()
946 symbols = mStyle->findSymbols( QgsStyle::SymbolEntity, QStringLiteral( "blue" ) ); in testTags()
949 symbols = mStyle->findSymbols( QgsStyle::SymbolEntity, QStringLiteral( "round" ) ); in testTags()
952 symbols = mStyle->findSymbols( QgsStyle::SymbolEntity, QStringLiteral( "МЕТЕОР" ) ); in testTags()
958 QVERIFY( mStyle->addColorRamp( "gradient_tag1", gradientRamp, true ) ); in testTags()
960 QVERIFY( mStyle->addColorRamp( "gradient_tag2", gradientRamp2, true ) ); in testTags()
962 …QVERIFY( mStyle->tagSymbol( QgsStyle::ColorrampEntity, "gradient_tag1", QStringList() << "blue" <<… in testTags()
968 …QVERIFY( mStyle->tagSymbol( QgsStyle::ColorrampEntity, "gradient_tag2", QStringList() << "red" << … in testTags()
975 …QVERIFY( !mStyle->tagSymbol( QgsStyle::ColorrampEntity, "no ramp", QStringList() << "red" << "circ… in testTags()
978 …QVERIFY( mStyle->tagSymbol( QgsStyle::ColorrampEntity, "gradient_tag2", QStringList() << "round ra… in testTags()
984 tags = mStyle->tags(); in testTags()
988 tags = mStyle->tagsOfSymbol( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_tag1" ) ); in testTags()
992 tags = mStyle->tagsOfSymbol( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_tag2" ) ); in testTags()
999 …QVERIFY( mStyle->detagSymbol( QgsStyle::ColorrampEntity, "gradient_tag1", QStringList() << "bad" <… in testTags()
1000 tags = mStyle->tagsOfSymbol( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_tag1" ) ); in testTags()
1009 QVERIFY( mStyle->detagSymbol( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_tag1" ) ) ); in testTags()
1010 tags = mStyle->tagsOfSymbol( QgsStyle::ColorrampEntity, QStringLiteral( "gradient_tag1" ) ); in testTags()
1021 QVERIFY( mStyle->addTextFormat( "format1", format1, true ) ); in testTags()
1023 QVERIFY( mStyle->addTextFormat( "format2", format2, true ) ); in testTags()
1025 …QVERIFY( mStyle->tagSymbol( QgsStyle::TextFormatEntity, "format1", QStringList() << "blue" << "sta… in testTags()
1031 …QVERIFY( mStyle->tagSymbol( QgsStyle::TextFormatEntity, "format2", QStringList() << "red" << "circ… in testTags()
1038 …QVERIFY( !mStyle->tagSymbol( QgsStyle::TextFormatEntity, "no format", QStringList() << "red" << "c… in testTags()
1041 …QVERIFY( mStyle->tagSymbol( QgsStyle::TextFormatEntity, "format2", QStringList() << "red text" ) ); in testTags()
1047 tags = mStyle->tags(); in testTags()
1051 tags = mStyle->tagsOfSymbol( QgsStyle::TextFormatEntity, QStringLiteral( "format1" ) ); in testTags()
1055 tags = mStyle->tagsOfSymbol( QgsStyle::TextFormatEntity, QStringLiteral( "format2" ) ); in testTags()
1062 …QVERIFY( mStyle->detagSymbol( QgsStyle::TextFormatEntity, "format1", QStringList() << "bad" << "bl… in testTags()
1063 tags = mStyle->tagsOfSymbol( QgsStyle::TextFormatEntity, QStringLiteral( "format1" ) ); in testTags()
1072 QVERIFY( mStyle->detagSymbol( QgsStyle::TextFormatEntity, QStringLiteral( "format1" ) ) ); in testTags()
1073 tags = mStyle->tagsOfSymbol( QgsStyle::TextFormatEntity, QStringLiteral( "format1" ) ); in testTags()
1085 QVERIFY( mStyle->addLabelSettings( "settings1", settings1, true ) ); in testTags()
1087 QVERIFY( mStyle->addLabelSettings( "settings2", settings2, true ) ); in testTags()
1089 …QVERIFY( mStyle->tagSymbol( QgsStyle::LabelSettingsEntity, "settings1", QStringList() << "blue" <<… in testTags()
1095 …QVERIFY( mStyle->tagSymbol( QgsStyle::LabelSettingsEntity, "settings2", QStringList() << "red" << … in testTags()
1102 …QVERIFY( !mStyle->tagSymbol( QgsStyle::LabelSettingsEntity, "no format", QStringList() << "red" <<… in testTags()
1105 …QVERIFY( mStyle->tagSymbol( QgsStyle::LabelSettingsEntity, "settings2", QStringList() << "red labe… in testTags()
1111 tags = mStyle->tags(); in testTags()
1115 tags = mStyle->tagsOfSymbol( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings1" ) ); in testTags()
1119 tags = mStyle->tagsOfSymbol( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings2" ) ); in testTags()
1126 …QVERIFY( mStyle->detagSymbol( QgsStyle::LabelSettingsEntity, "settings1", QStringList() << "bad" <… in testTags()
1127 tags = mStyle->tagsOfSymbol( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings1" ) ); in testTags()
1136 QVERIFY( mStyle->detagSymbol( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings1" ) ) ); in testTags()
1137 tags = mStyle->tagsOfSymbol( QgsStyle::LabelSettingsEntity, QStringLiteral( "settings1" ) ); in testTags()
1149 QVERIFY( mStyle->addLegendPatchShape( "shape1", shape1, true ) ); in testTags()
1151 QVERIFY( mStyle->addLegendPatchShape( "shape2", shape2, true ) ); in testTags()
1153 …QVERIFY( mStyle->tagSymbol( QgsStyle::LegendPatchShapeEntity, "shape1", QStringList() << "blue" <<… in testTags()
1159 …QVERIFY( mStyle->tagSymbol( QgsStyle::LegendPatchShapeEntity, "shape2", QStringList() << "red" << … in testTags()
1166 …QVERIFY( !mStyle->tagSymbol( QgsStyle::LegendPatchShapeEntity, "no patch", QStringList() << "red" … in testTags()
1169 …QVERIFY( mStyle->tagSymbol( QgsStyle::LegendPatchShapeEntity, "shape2", QStringList() << "red patc… in testTags()
1175 tags = mStyle->tags(); in testTags()
1179 tags = mStyle->tagsOfSymbol( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "shape1" ) ); in testTags()
1183 tags = mStyle->tagsOfSymbol( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "shape2" ) ); in testTags()
1190 …QVERIFY( mStyle->detagSymbol( QgsStyle::LegendPatchShapeEntity, "shape1", QStringList() << "bad" <… in testTags()
1191 tags = mStyle->tagsOfSymbol( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "shape1" ) ); in testTags()
1200 QVERIFY( mStyle->detagSymbol( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "shape1" ) ) ); in testTags()
1201 tags = mStyle->tagsOfSymbol( QgsStyle::LegendPatchShapeEntity, QStringLiteral( "shape1" ) ); in testTags()
1212 QVERIFY( mStyle->addSymbol3D( "3dsymbol1", symbol3d1.clone(), true ) ); in testTags()
1214 QVERIFY( mStyle->addSymbol3D( "3dsymbol2", symbol3d2.clone(), true ) ); in testTags()
1216 …QVERIFY( mStyle->tagSymbol( QgsStyle::Symbol3DEntity, "3dsymbol1", QStringList() << "blue" << "sta… in testTags()
1222 …QVERIFY( mStyle->tagSymbol( QgsStyle::Symbol3DEntity, "3dsymbol2", QStringList() << "red" << "circ… in testTags()
1229 …QVERIFY( !mStyle->tagSymbol( QgsStyle::Symbol3DEntity, "no patch", QStringList() << "red" << "circ… in testTags()
1232 …QVERIFY( mStyle->tagSymbol( QgsStyle::Symbol3DEntity, "3dsymbol2", QStringList() << "red patch" ) … in testTags()
1238 tags = mStyle->tags(); in testTags()
1242 tags = mStyle->tagsOfSymbol( QgsStyle::Symbol3DEntity, QStringLiteral( "3dsymbol1" ) ); in testTags()
1246 tags = mStyle->tagsOfSymbol( QgsStyle::Symbol3DEntity, QStringLiteral( "3dsymbol2" ) ); in testTags()
1253 …QVERIFY( mStyle->detagSymbol( QgsStyle::Symbol3DEntity, "3dsymbol1", QStringList() << "bad" << "bl… in testTags()
1254 tags = mStyle->tagsOfSymbol( QgsStyle::Symbol3DEntity, QStringLiteral( "3dsymbol1" ) ); in testTags()
1263 QVERIFY( mStyle->detagSymbol( QgsStyle::Symbol3DEntity, QStringLiteral( "3dsymbol1" ) ) ); in testTags()
1264 tags = mStyle->tagsOfSymbol( QgsStyle::Symbol3DEntity, QStringLiteral( "3dsymbol1" ) ); in testTags()