-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
105 kaavakohteen luominen ilman templaattia, yleisiä muutoksia kaavakohteen luomiseen ja kaavakohdekirjastoihin #106
Conversation
Some refactoring was done for related functionalities
- deleted feature_template_library: some functions moved to PlanManager, some to NewFeatureDock - deleted template_library_config: FeatureTemplateLibrary renamed and moved to models.py - renamed template_dock -> new_feature_dock - changed PlanFeatureForm to be initialized from a PlanFeature, following the logic of other form and widget initialization. similarly, FeatureTemplateLibrary now consists of PlanFeatures - WIP: regulation group initialization from plan feature template config, continue designing the new dock
…efactoring - fix PlanDigitizeMapTool to reinitialize itself after layer changes - implement similar config file fetching for regulation group libraries as for feature templates - reorganize library files in resources folder - deactivate selections in NewFeatureDock when PlanFeatureDigitizeMapTool finishes/deactivates
self.initialize_feature_digitize_map_tool() | ||
|
||
def initialize_feature_digitize_map_tool(self, layer: QgsVectorLayer | None = None): | ||
# Get matcing capture mode for given layer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tarviiko näitä. Käsittääkseni QgsMapToolDigitizeFeature.setLayer()
hoitaa tän automaattisesti.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taitaa tarvita, ainakin siltä vaikutti. Tätä voi kyllä testata vielä jossain kohtaa uudestaan
@@ -102,6 +184,24 @@ def _plan_geom_digitized(self, feature: QgsFeature): | |||
|
|||
iface.mapCanvas().setMapTool(self.previous_map_tool) | |||
|
|||
def _plan_feature_geom_digitized(self, feature: QgsFeature): | |||
# NOTE: What if user has changed dock selections while digitizng? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hyvä huomio. Näistä kaikista vastaavista voisi tehdä issuen GitHubiin.
for index in range(self.template_list.count()): | ||
item = self.template_list.item(index) | ||
item_text = item.text().lower() | ||
plan_feature: PlanFeature = item.data(Qt.UserRole) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hyvä tapa olisi luoda kutakin käyttötarkoitusta varten oma UserRole. Käytännössä Qt.UserRole
(rolet ylseisestikin) on vaan integer, joka kertoo mistä alkaa käyttäjälle varatut integerarvot (maksimi on Qt.MaxUserRole
).
from enum import IntEnum
class CustomDataRole(IntEnum):
FeatureRole = Qt.UserRole
SomeOtherRole = Qt.UserRole +1
...
feature = PlanFeature()
item.setData(CustomDataRole.FeatureRole, feature)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tehdään tästä asiasta yleinen issue
No description provided.