From 41e37e63122def3ea84671db48d8b25827b073bb Mon Sep 17 00:00:00 2001 From: Niko Aarnio Date: Fri, 25 Oct 2024 14:11:21 +0300 Subject: [PATCH 1/5] feat: add feature template form draft version --- .../core/feature_template_library.py | 4 +- .../core/template_library_config.py | 11 +- .../gui/plan_regulation_group_widget.py | 108 ++++++++++ .../gui/plan_regulation_group_widget.ui | 196 ++++++++++++++++++ .../gui/template_attribute_form.py | 80 +++++++ .../gui/template_attribute_form.ui | 164 +++++++++++++++ .../resources/icons/settings.svg | 1 + .../template_libraries/asemakaava-sample.yaml | 7 + 8 files changed, 568 insertions(+), 3 deletions(-) create mode 100644 arho_feature_template/gui/plan_regulation_group_widget.py create mode 100644 arho_feature_template/gui/plan_regulation_group_widget.ui create mode 100644 arho_feature_template/gui/template_attribute_form.py create mode 100644 arho_feature_template/gui/template_attribute_form.ui create mode 100644 arho_feature_template/resources/icons/settings.svg diff --git a/arho_feature_template/core/feature_template_library.py b/arho_feature_template/core/feature_template_library.py index 202ad5d..7d0bedb 100644 --- a/arho_feature_template/core/feature_template_library.py +++ b/arho_feature_template/core/feature_template_library.py @@ -16,7 +16,7 @@ TemplateSyntaxError, parse_template_library_config, ) -from arho_feature_template.gui.feature_attribute_form import FeatureAttributeForm +from arho_feature_template.gui.template_attribute_form import TemplateAttributeForm from arho_feature_template.gui.template_dock import TemplateLibraryDock from arho_feature_template.resources.template_libraries import library_config_files @@ -181,7 +181,7 @@ def ask_for_feature_attributes(self, feature: QgsFeature) -> None: if not self.active_template: return - attribute_form = FeatureAttributeForm(self.active_template.config.feature) + attribute_form = TemplateAttributeForm(self.active_template.config) if attribute_form.exec_(): layer = get_layer_from_project(self.active_template.config.feature.layer) diff --git a/arho_feature_template/core/template_library_config.py b/arho_feature_template/core/template_library_config.py index 1512bd1..4a3cb90 100644 --- a/arho_feature_template/core/template_library_config.py +++ b/arho_feature_template/core/template_library_config.py @@ -113,10 +113,19 @@ class Attribute: attribute: str default: str | None + description: str | None @classmethod def from_dict(cls, data: dict) -> Attribute: - return cls(attribute=data["attribute"], default=data.get("default")) + return cls(attribute=data["attribute"], default=data.get("default"), description=data.get("description")) + + def display(self) -> str: + if self.description is not None: + return self.description + elif self.default is not None: + return self.default + else: + return "" def parse_template_library_config(template_library_config: Path) -> TemplateLibraryConfig: diff --git a/arho_feature_template/gui/plan_regulation_group_widget.py b/arho_feature_template/gui/plan_regulation_group_widget.py new file mode 100644 index 0000000..96e5784 --- /dev/null +++ b/arho_feature_template/gui/plan_regulation_group_widget.py @@ -0,0 +1,108 @@ +from __future__ import annotations + +from collections import defaultdict +from importlib import resources +from typing import TYPE_CHECKING + +from qgis.core import QgsApplication +from qgis.PyQt import uic +from qgis.PyQt.QtGui import QFont, QIcon +from qgis.PyQt.QtWidgets import QLabel, QLineEdit, QWidget + +from arho_feature_template.qgis_plugin_tools.tools.resources import plugin_path + +if TYPE_CHECKING: + from qgis.gui import QgsCollapsibleGroupBox + from qgis.PyQt.QtWidgets import QGridLayout, QPushButton + + from arho_feature_template.core.template_library_config import Feature + +ui_path = resources.files(__package__) / "plan_regulation_group_widget.ui" +FormClass, _ = uic.loadUiType(ui_path) + + +class PlanRegulationGroupWidget(QWidget, FormClass): # type: ignore + """A widget representation of a plan regulation group.""" + + def __init__(self, feature: Feature): + super().__init__() + self.setupUi(self) + + # TYPES + self.heading: QLineEdit + self.conf_btn: QPushButton + self.del_btn: QPushButton + + self.plan_regulation_groupbox: QgsCollapsibleGroupBox + self.plan_regulation_grid_layout: QGridLayout + + # INIT + self.feature = feature + self.layer = self.feature.layer # Should be plan_regulation_group layer + + self.input_value_header = None + self.input_value_col = None + + self.additional_information_header = None + self.additional_information_col = None + + self.bold_font = QFont() + self.bold_font.setBold(True) + + self.init_buttons() + + self.attribute_widgets: dict[str, dict[str, QWidget]] = defaultdict(dict) + + for attribute_config in feature.attributes: + if attribute_config.attribute == "name": + self.heading.setText(attribute_config.display()) + + if feature.child_features is not None: + for child in feature.child_features: + if child.layer == "plan_requlation": + self.create_widgets_for_plan_regulation(child) + + def init_buttons(self): + self.conf_btn.setIcon(QIcon(plugin_path("resources", "icons", "settings.svg"))) + self.del_btn.setIcon(QgsApplication.getThemeIcon("mActionDeleteSelected.svg")) + + def create_widgets_for_plan_regulation(self, plan_regulation_feature: Feature): + row = self.plan_regulation_grid_layout.rowCount() + 1 + for plan_regulation_config in plan_regulation_feature.attributes: + if plan_regulation_config.attribute == "type_of_plan_regulation_id": + id_label = QLabel(plan_regulation_config.display()) + print(plan_regulation_config) + self.plan_regulation_grid_layout.addWidget(id_label, row, 0) + elif plan_regulation_config.attribute == "numeric_default": + if not self.input_value_header: + self.input_value_header = QLabel("Arvo") + self.input_value_header.setFont(self.bold_font) + self.input_value_col = self.plan_regulation_grid_layout.columnCount() + 1 + self.plan_regulation_grid_layout.addWidget(self.input_value_header, 0, self.input_value_col) + + input_field = QLineEdit() + self.plan_regulation_grid_layout.addWidget(input_field, row, self.input_value_col) + + if plan_regulation_feature.child_features is None: + return + for child in plan_regulation_feature.child_features: + # Additional information here, what else? + # Assume attribute is "additional_information_of_plan_regulation" + # NOTE: Could additional information be attribute of plan regulation instead of child feature? + + # Add header if not added yet + if not self.additional_information_header: + self.additional_information_header = QLabel("Lisätiedot") + self.additional_information_header.setFont(self.bold_font) + self.additonal_information_col = self.plan_regulation_grid_layout.columnCount() + 1 + self.plan_regulation_grid_layout.addWidget( + self.additional_information_header, 0, self.additonal_information_col + ) + + # TBD: Multiple additional feature per plan regulation + for attribute in child.attributes: + # Assume "type_of_additional_information_id" + additional_information_label = QLabel(attribute.display()) + self.plan_regulation_grid_layout.addWidget( + additional_information_label, row, self.additonal_information_col + ) diff --git a/arho_feature_template/gui/plan_regulation_group_widget.ui b/arho_feature_template/gui/plan_regulation_group_widget.ui new file mode 100644 index 0000000..d7a965c --- /dev/null +++ b/arho_feature_template/gui/plan_regulation_group_widget.ui @@ -0,0 +1,196 @@ + + + plan_regulation_group_form + + + + 0 + 0 + 582 + 195 + + + + Form + + + + + + + + + 0 + 0 + + + + Otsikko: + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Maximum + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + false + + + false + + + + + + + + + 0 + 0 + + + + + 175 + 0 + + + + + 175 + 16777215 + + + + + 75 + true + + + + Kaavamääräyslaji + + + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + + + + + + + QgsCollapsibleGroupBox + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
+ + +
diff --git a/arho_feature_template/gui/template_attribute_form.py b/arho_feature_template/gui/template_attribute_form.py new file mode 100644 index 0000000..e73b257 --- /dev/null +++ b/arho_feature_template/gui/template_attribute_form.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +from importlib import resources +from typing import TYPE_CHECKING + +from qgis.PyQt import uic +from qgis.PyQt.QtWidgets import ( + QDialog, + QDialogButtonBox, + QLineEdit, + QMenu, + QPushButton, + QScrollArea, + QSizePolicy, + QSpacerItem, +) + +from arho_feature_template.gui.plan_regulation_group_widget import PlanRegulationGroupWidget + +if TYPE_CHECKING: + from qgis.PyQt.QtWidgets import QWidget + + from arho_feature_template.core.template_library_config import FeatureTemplate + +ui_path = resources.files(__package__) / "template_attribute_form.ui" +FormClass, _ = uic.loadUiType(ui_path) + + +class TemplateAttributeForm(QDialog, FormClass): # type: ignore + """Parent class for feature template forms for adding and modifying feature attribute data.""" + + def __init__(self, feature_template_config: FeatureTemplate): + super().__init__() + self.setupUi(self) + + # TYPES + self.feature_name: QLineEdit + self.feature_description: QLineEdit + self.feature_underground: QLineEdit + self.feature_vertical_boundaries: QLineEdit + self.plan_regulation_group_scrollarea: QScrollArea + self.plan_regulation_group_scrollarea_contents: QWidget + self.add_plan_regulation_group_btn: QPushButton + self.button_box: QDialogButtonBox + + # SIGNALS + self.button_box.accepted.connect(self._on_ok_clicked) + + # INIT + self.setWindowTitle(feature_template_config.name) + self.init_plan_regulation_groups(feature_template_config) + self.scroll_area_spacer = QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding) + self.plan_regulation_group_scrollarea_contents.layout().addItem(self.scroll_area_spacer) + self.init_add_plan_regulation_group_btn() + + def init_add_plan_regulation_group_btn(self): + menu = QMenu() + self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 1") + self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 2") + self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 3") + self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 4") + self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 5") + self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 6") + self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 7") + self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 8") + self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 9") + + self.add_plan_regulation_group_btn.setMenu(menu) + + def init_plan_regulation_groups(self, feature_template_config: FeatureTemplate): + for child_feature in feature_template_config.feature.child_features: + if child_feature.layer == "plan_requlation_group": + plan_regulation_group_entry = PlanRegulationGroupWidget(child_feature) + self.plan_regulation_group_scrollarea_contents.layout().addWidget(plan_regulation_group_entry) + else: + # TODO + print(f"Encountered child feature with unrecognized layer: {child_feature.layer}") + + def _on_ok_clicked(self): + self.accept() diff --git a/arho_feature_template/gui/template_attribute_form.ui b/arho_feature_template/gui/template_attribute_form.ui new file mode 100644 index 0000000..be51e61 --- /dev/null +++ b/arho_feature_template/gui/template_attribute_form.ui @@ -0,0 +1,164 @@ + + + template_form + + + + 0 + 0 + 640 + 752 + + + + Template form + + + + + + + + Kohteen nimi + + + + + + + + + + Kohteen kuvaus + + + + + + + + + + Maanalaisuus + + + + + + + + + + Pystysuuntainen rajaus + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 10 + + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 10 + + + + + + + + Kaavamääräykset + + + + + + + true + + + + + 0 + 0 + 620 + 509 + + + + + + + + + + + + Lisää kaavamääräysryhmä + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + button_box + rejected() + template_form + reject() + + + 414 + 729 + + + 319 + 375 + + + + + diff --git a/arho_feature_template/resources/icons/settings.svg b/arho_feature_template/resources/icons/settings.svg new file mode 100644 index 0000000..956de27 --- /dev/null +++ b/arho_feature_template/resources/icons/settings.svg @@ -0,0 +1 @@ + diff --git a/arho_feature_template/resources/template_libraries/asemakaava-sample.yaml b/arho_feature_template/resources/template_libraries/asemakaava-sample.yaml index b7901f8..b6cf67f 100644 --- a/arho_feature_template/resources/template_libraries/asemakaava-sample.yaml +++ b/arho_feature_template/resources/template_libraries/asemakaava-sample.yaml @@ -32,34 +32,40 @@ templates: attributes: - attribute: type_of_plan_regulation_id default: asumisenAlue + description: Asumisen alue hidden: true child_features: - layer: additional_information_of_plan_regulation attributes: - attribute: type_of_additional_information_id default: paakayttotarkoitus + description: Pääkäyttötarkoitus hidden: true - layer: plan_requlation attributes: - attribute: type_of_plan_regulation_id default: liikerakennustenAlue + description: Liikerakennusten alue hidden: true child_features: - layer: additional_information_of_plan_regulation attributes: - attribute: type_of_additional_information_id default: paakayttotarkoitus + description: Pääkäyttötarkoitus hidden: true - layer: plan_requlation attributes: - attribute: type_of_plan_regulation_id default: toimitilojenAlue + description: Toimitilojen alue hidden: true child_features: - layer: additional_information_of_plan_regulation attributes: - attribute: type_of_additional_information_id default: paakayttotarkoitus + description: Pääkäyttötarkoitus hidden: true - layer: plan_requlation_group attributes: @@ -71,4 +77,5 @@ templates: attributes: - attribute: type_of_plan_regulation_id default: korttelinNumero + description: Korttelin numero - attribute: numeric_default From 2287c42eb167284f7ed771178cc639af43bdab29 Mon Sep 17 00:00:00 2001 From: Niko Aarnio <113038549+nmaarnio@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:55:00 +0200 Subject: [PATCH 2/5] implement remove plan regulation group button --- .../gui/plan_regulation_group_widget.py | 9 ++- .../gui/template_attribute_form.py | 51 +++++++++---- arho_feature_template/resources/katja.yaml | 74 +++++++++++++++++++ 3 files changed, 120 insertions(+), 14 deletions(-) create mode 100644 arho_feature_template/resources/katja.yaml diff --git a/arho_feature_template/gui/plan_regulation_group_widget.py b/arho_feature_template/gui/plan_regulation_group_widget.py index 96e5784..916bcbb 100644 --- a/arho_feature_template/gui/plan_regulation_group_widget.py +++ b/arho_feature_template/gui/plan_regulation_group_widget.py @@ -6,6 +6,7 @@ from qgis.core import QgsApplication from qgis.PyQt import uic +from qgis.PyQt.QtCore import pyqtSignal from qgis.PyQt.QtGui import QFont, QIcon from qgis.PyQt.QtWidgets import QLabel, QLineEdit, QWidget @@ -24,6 +25,8 @@ class PlanRegulationGroupWidget(QWidget, FormClass): # type: ignore """A widget representation of a plan regulation group.""" + delete_signal = pyqtSignal(QWidget) + def __init__(self, feature: Feature): super().__init__() self.setupUi(self) @@ -62,16 +65,20 @@ def __init__(self, feature: Feature): if child.layer == "plan_requlation": self.create_widgets_for_plan_regulation(child) + def request_delete(self): + self.delete_signal.emit(self) + def init_buttons(self): self.conf_btn.setIcon(QIcon(plugin_path("resources", "icons", "settings.svg"))) self.del_btn.setIcon(QgsApplication.getThemeIcon("mActionDeleteSelected.svg")) + self.del_btn.clicked.connect(self.request_delete) def create_widgets_for_plan_regulation(self, plan_regulation_feature: Feature): row = self.plan_regulation_grid_layout.rowCount() + 1 for plan_regulation_config in plan_regulation_feature.attributes: if plan_regulation_config.attribute == "type_of_plan_regulation_id": id_label = QLabel(plan_regulation_config.display()) - print(plan_regulation_config) + # print(plan_regulation_config) self.plan_regulation_grid_layout.addWidget(id_label, row, 0) elif plan_regulation_config.attribute == "numeric_default": if not self.input_value_header: diff --git a/arho_feature_template/gui/template_attribute_form.py b/arho_feature_template/gui/template_attribute_form.py index e73b257..23b10e7 100644 --- a/arho_feature_template/gui/template_attribute_form.py +++ b/arho_feature_template/gui/template_attribute_form.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: from qgis.PyQt.QtWidgets import QWidget - from arho_feature_template.core.template_library_config import FeatureTemplate + from arho_feature_template.core.template_library_config import Feature, FeatureTemplate ui_path = resources.files(__package__) / "template_attribute_form.ui" FormClass, _ = uic.loadUiType(ui_path) @@ -47,31 +47,56 @@ def __init__(self, feature_template_config: FeatureTemplate): self.button_box.accepted.connect(self._on_ok_clicked) # INIT + self.scroll_area_spacer = None + self.available_plan_regulation_group_configs: list[Feature] = [] + self.setWindowTitle(feature_template_config.name) self.init_plan_regulation_groups(feature_template_config) + self.init_add_plan_regulation_group_btn() + + def add_spacer(self): self.scroll_area_spacer = QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding) self.plan_regulation_group_scrollarea_contents.layout().addItem(self.scroll_area_spacer) - self.init_add_plan_regulation_group_btn() + + def remove_spacer(self): + if self.scroll_area_spacer is not None: + self.plan_regulation_group_scrollarea_contents.layout().removeItem(self.scroll_area_spacer) + self.scroll_area_spacer = None + + def add_plan_regulation_group(self, feature_config: Feature): + new_plan_regulation_group = PlanRegulationGroupWidget(feature_config) + new_plan_regulation_group.delete_signal.connect(self.remove_plan_regulation_group) + self.remove_spacer() + self.plan_regulation_group_scrollarea_contents.layout().addWidget(new_plan_regulation_group) + self.add_spacer() + + def remove_plan_regulation_group(self, plan_regulation_group_widget: PlanRegulationGroupWidget): + self.plan_regulation_group_scrollarea_contents.layout().removeWidget(plan_regulation_group_widget) + plan_regulation_group_widget.deleteLater() def init_add_plan_regulation_group_btn(self): menu = QMenu() - self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 1") - self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 2") - self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 3") - self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 4") - self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 5") - self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 6") - self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 7") - self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 8") - self.new_mineral_system_action = menu.addAction("Kaavamääräysryhmä 9") + for config in self.available_plan_regulation_group_configs: + plan_regulation_group_name = "" + for attribute in config.attributes: + if attribute.attribute == "name": + plan_regulation_group_name = attribute.display() + + action = menu.addAction(plan_regulation_group_name) + action.triggered.connect(lambda _, config=config: self.add_plan_regulation_group(config)) self.add_plan_regulation_group_btn.setMenu(menu) def init_plan_regulation_groups(self, feature_template_config: FeatureTemplate): + if feature_template_config.feature.child_features is None: + return for child_feature in feature_template_config.feature.child_features: if child_feature.layer == "plan_requlation_group": - plan_regulation_group_entry = PlanRegulationGroupWidget(child_feature) - self.plan_regulation_group_scrollarea_contents.layout().addWidget(plan_regulation_group_entry) + # Collect encountered plan regulation groups in init + # This does not need to be done if Katja config file is read beforehand and + # that handles available plan regulation groups + self.available_plan_regulation_group_configs.append(child_feature) + self.add_plan_regulation_group(child_feature) else: # TODO print(f"Encountered child feature with unrecognized layer: {child_feature.layer}") diff --git a/arho_feature_template/resources/katja.yaml b/arho_feature_template/resources/katja.yaml new file mode 100644 index 0000000..da0ceb1 --- /dev/null +++ b/arho_feature_template/resources/katja.yaml @@ -0,0 +1,74 @@ +aluevaraukset: + - geometria: Alue + värikoodi: #000000 + kirjaintunnus: A + kaavamääräyksen_otsikko: Asuinrakennusten alue + kaavamääräykset: + - nimi: Asumisen alue + lisätiedot: + - laji: Pääkäyttötarkoitus + + - geometria: Alue + värikoodi: #000000 + kirjaintunnus: AK + kaavamääräyksen_otsikko: Asuinkerrostalojen alue + kaavamääräykset: + - nimi: Asuinkerrostaloalue + lisätiedot: + - laji: Pääkäyttötarkoitus + + - geometria: Alue + värikoodi: "#A9D08E" + kirjaintunnus: AP + kaavamääräyksen_otsikko: Asuinpientalojen alue + kaavamääräykset: + - nimi: Asuinpientaloalue + lisätiedot: + - laji: Pääkäyttötarkoitus + + - geometria: Alue + värikoodi: "#FFD966" + kirjaintunnus: AR + kaavamääräyksen_otsikko: Rivitalojen ja muiden kytkettyjen asuinrakennusten alue + kaavamääräykset: + - nimi: Rivitalojen ja muiden kytkettyjen asuinpientalojen alue + lisätiedot: + - laji: Pääkäyttötarkoitus + + - geometria: Alue + värikoodi: "#E06666" + kirjaintunnus: AO + kaavamääräyksen_otsikko: Erillispientalojen alue + kaavamääräykset: + - nimi: Erillisten asuinpientalojen alue + lisätiedot: + - laji: Pääkäyttötarkoitus + + - geometria: Alue + värikoodi: "#5B9BD5" + kirjaintunnus: AL + kaavamääräyksen_otsikko: Asuin-, liike- ja toimistorakennusten alue + kaavamääräykset: + - nimi: Asumisen alue + - nimi: Liikerakennusten alue + - nimi: Toimistorakennusten alue + lisätiedot: + - laji: Pääkäyttötarkoitus + + - geometria: Alue + värikoodi: "#9BC2E6" + kirjaintunnus: AH + kaavamääräyksen_otsikko: Asumista palveleva yhteiskäyttöinen alue + kaavamääräykset: + - nimi: Asumista palveleva yhteiskäyttöinen alue + lisätiedot: + - laji: Pääkäyttötarkoitus + + - geometria: Alue + värikoodi: "#FFD966" + kirjaintunnus: AM + kaavamääräyksen_otsikko: Maatilojen talouskeskusten alue + kaavamääräykset: + - nimi: Maatilan talouskeskuksen alue + lisätiedot: + - laji: Pääkäyttötarkoitus From 0e88381bc2e637a92ec5be5d9a2fe60db66c07d2 Mon Sep 17 00:00:00 2001 From: Niko Aarnio <113038549+nmaarnio@users.noreply.github.com> Date: Tue, 29 Oct 2024 15:57:40 +0200 Subject: [PATCH 3/5] Implement add plan regulation group button From 69fead564b229551d791ec2b9f007db148dcebea Mon Sep 17 00:00:00 2001 From: Niko Aarnio Date: Tue, 29 Oct 2024 16:36:47 +0200 Subject: [PATCH 4/5] add new template attribute form --- .../gui/template_attribute_form.py | 6 +- .../gui/template_attribute_form2.ui | 289 ++++++++++++++++++ 2 files changed, 292 insertions(+), 3 deletions(-) create mode 100644 arho_feature_template/gui/template_attribute_form2.ui diff --git a/arho_feature_template/gui/template_attribute_form.py b/arho_feature_template/gui/template_attribute_form.py index 23b10e7..7b1013b 100644 --- a/arho_feature_template/gui/template_attribute_form.py +++ b/arho_feature_template/gui/template_attribute_form.py @@ -22,7 +22,7 @@ from arho_feature_template.core.template_library_config import Feature, FeatureTemplate -ui_path = resources.files(__package__) / "template_attribute_form.ui" +ui_path = resources.files(__package__) / "template_attribute_form2.ui" FormClass, _ = uic.loadUiType(ui_path) @@ -40,7 +40,7 @@ def __init__(self, feature_template_config: FeatureTemplate): self.feature_vertical_boundaries: QLineEdit self.plan_regulation_group_scrollarea: QScrollArea self.plan_regulation_group_scrollarea_contents: QWidget - self.add_plan_regulation_group_btn: QPushButton + # self.add_plan_regulation_group_btn: QPushButton self.button_box: QDialogButtonBox # SIGNALS @@ -52,7 +52,7 @@ def __init__(self, feature_template_config: FeatureTemplate): self.setWindowTitle(feature_template_config.name) self.init_plan_regulation_groups(feature_template_config) - self.init_add_plan_regulation_group_btn() + # self.init_add_plan_regulation_group_btn() def add_spacer(self): self.scroll_area_spacer = QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding) diff --git a/arho_feature_template/gui/template_attribute_form2.ui b/arho_feature_template/gui/template_attribute_form2.ui new file mode 100644 index 0000000..c1fe2d3 --- /dev/null +++ b/arho_feature_template/gui/template_attribute_form2.ui @@ -0,0 +1,289 @@ + + + template_form + + + + 0 + 0 + 757 + 749 + + + + Template form + + + + + + + + Kohteen nimi + + + + + + + + + + Kohteen kuvaus + + + + + + + + + + Maanalaisuus + + + + + + + + + + Pystysuuntainen rajaus + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 10 + + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 10 + + + + + + + + + + + + Lisää kaavamääräysryhmä + + + + + + + + 0 + 0 + + + + false + + + + 1 + + + + + Aluevaraukset + + + + Asuinrakennusten alue + + + + + Asuinkerrostalojen alue + + + + + Asuinpientalojen alue + + + + + Rivitalojen ja muiden kytkettyjen asuinrakennusten alue + + + + + Erillispientalojen alue + + + + + + Rakennusalat + + + + Kunnan tai kaupunginosas raja + + + + + Korttelialue tai korttelialueen osa + + + + + Sitovan tonttijaon mukainen tontti + + + + + Ohjeellinen tontti / rakennusala + + + + + Rakennusala + + + + + + Numeeriset ja tekstimuotoiset määräykset + + + + Kaupungin- tai kunnanosan numero + + + + + Kaupungin- tai kunnanosan nimi + + + + + Korttelin numero + + + + + Tontin tai rakennuspaikan numero + + + + + Ohjeellisen tontin tai rakennuspaikan numero + + + + + Kadun tai tien nimi + + + + + + + + + + + + + Kaavamääräykset + + + + + + + true + + + + + 0 + 0 + 469 + 502 + + + + + + + + + + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + button_box + rejected() + template_form + reject() + + + 414 + 729 + + + 319 + 375 + + + + + From fda2581be457d97bdc28c56874c2a89840c2c12b Mon Sep 17 00:00:00 2001 From: Niko Aarnio Date: Wed, 30 Oct 2024 09:45:22 +0200 Subject: [PATCH 5/5] make new template attribute form initialize itself correctly, attempt simple feature saving (WIP) --- .../core/feature_template_library.py | 7 +- .../core/template_library_config.py | 5 +- .../gui/plan_regulation_group_widget.py | 91 ++---- .../gui/plan_regulation_group_widget.ui | 219 ++++--------- .../gui/plan_regulation_group_widget_old.ui | 196 ++++++++++++ .../gui/plan_regulation_widget.py | 105 +++++++ .../gui/plan_regulation_widget.ui | 41 +++ .../gui/template_attribute_form.py | 70 +++-- .../gui/template_attribute_form.ui | 248 ++++++++++++--- .../gui/template_attribute_form2.ui | 289 ------------------ .../gui/template_attribute_form_old.ui | 164 ++++++++++ 11 files changed, 845 insertions(+), 590 deletions(-) create mode 100644 arho_feature_template/gui/plan_regulation_group_widget_old.ui create mode 100644 arho_feature_template/gui/plan_regulation_widget.py create mode 100644 arho_feature_template/gui/plan_regulation_widget.ui delete mode 100644 arho_feature_template/gui/template_attribute_form2.ui create mode 100644 arho_feature_template/gui/template_attribute_form_old.ui diff --git a/arho_feature_template/core/feature_template_library.py b/arho_feature_template/core/feature_template_library.py index 7d0bedb..e6dc6e4 100644 --- a/arho_feature_template/core/feature_template_library.py +++ b/arho_feature_template/core/feature_template_library.py @@ -186,12 +186,7 @@ def ask_for_feature_attributes(self, feature: QgsFeature) -> None: if attribute_form.exec_(): layer = get_layer_from_project(self.active_template.config.feature.layer) # Save the feature - for attributes in attribute_form.attribute_widgets.values(): - for attribute, widget in attributes.items(): - feature.setAttribute( - attribute, - widget.text(), - ) + attribute_form.set_feature_attributes(feature) layer.beginEditCommand("Create feature from template") layer.addFeature(feature) diff --git a/arho_feature_template/core/template_library_config.py b/arho_feature_template/core/template_library_config.py index 4a3cb90..e8fb8d4 100644 --- a/arho_feature_template/core/template_library_config.py +++ b/arho_feature_template/core/template_library_config.py @@ -122,10 +122,9 @@ def from_dict(cls, data: dict) -> Attribute: def display(self) -> str: if self.description is not None: return self.description - elif self.default is not None: + if self.default is not None: return self.default - else: - return "" + return "" def parse_template_library_config(template_library_config: Path) -> TemplateLibraryConfig: diff --git a/arho_feature_template/gui/plan_regulation_group_widget.py b/arho_feature_template/gui/plan_regulation_group_widget.py index 916bcbb..5717327 100644 --- a/arho_feature_template/gui/plan_regulation_group_widget.py +++ b/arho_feature_template/gui/plan_regulation_group_widget.py @@ -1,20 +1,17 @@ from __future__ import annotations -from collections import defaultdict from importlib import resources from typing import TYPE_CHECKING from qgis.core import QgsApplication from qgis.PyQt import uic from qgis.PyQt.QtCore import pyqtSignal -from qgis.PyQt.QtGui import QFont, QIcon -from qgis.PyQt.QtWidgets import QLabel, QLineEdit, QWidget +from qgis.PyQt.QtWidgets import QWidget -from arho_feature_template.qgis_plugin_tools.tools.resources import plugin_path +from arho_feature_template.gui.plan_regulation_widget import PlanRegulationWidget if TYPE_CHECKING: - from qgis.gui import QgsCollapsibleGroupBox - from qgis.PyQt.QtWidgets import QGridLayout, QPushButton + from qgis.PyQt.QtWidgets import QFrame, QLineEdit, QPushButton from arho_feature_template.core.template_library_config import Feature @@ -32,84 +29,36 @@ def __init__(self, feature: Feature): self.setupUi(self) # TYPES + self.frame: QFrame self.heading: QLineEdit - self.conf_btn: QPushButton self.del_btn: QPushButton - self.plan_regulation_groupbox: QgsCollapsibleGroupBox - self.plan_regulation_grid_layout: QGridLayout - # INIT self.feature = feature self.layer = self.feature.layer # Should be plan_regulation_group layer - self.input_value_header = None - self.input_value_col = None - - self.additional_information_header = None - self.additional_information_col = None - - self.bold_font = QFont() - self.bold_font.setBold(True) - self.init_buttons() - - self.attribute_widgets: dict[str, dict[str, QWidget]] = defaultdict(dict) - - for attribute_config in feature.attributes: - if attribute_config.attribute == "name": - self.heading.setText(attribute_config.display()) - - if feature.child_features is not None: - for child in feature.child_features: - if child.layer == "plan_requlation": - self.create_widgets_for_plan_regulation(child) + self.set_group_heading() + self.add_plan_regulation_widgets() def request_delete(self): self.delete_signal.emit(self) def init_buttons(self): - self.conf_btn.setIcon(QIcon(plugin_path("resources", "icons", "settings.svg"))) self.del_btn.setIcon(QgsApplication.getThemeIcon("mActionDeleteSelected.svg")) self.del_btn.clicked.connect(self.request_delete) - def create_widgets_for_plan_regulation(self, plan_regulation_feature: Feature): - row = self.plan_regulation_grid_layout.rowCount() + 1 - for plan_regulation_config in plan_regulation_feature.attributes: - if plan_regulation_config.attribute == "type_of_plan_regulation_id": - id_label = QLabel(plan_regulation_config.display()) - # print(plan_regulation_config) - self.plan_regulation_grid_layout.addWidget(id_label, row, 0) - elif plan_regulation_config.attribute == "numeric_default": - if not self.input_value_header: - self.input_value_header = QLabel("Arvo") - self.input_value_header.setFont(self.bold_font) - self.input_value_col = self.plan_regulation_grid_layout.columnCount() + 1 - self.plan_regulation_grid_layout.addWidget(self.input_value_header, 0, self.input_value_col) - - input_field = QLineEdit() - self.plan_regulation_grid_layout.addWidget(input_field, row, self.input_value_col) - - if plan_regulation_feature.child_features is None: - return - for child in plan_regulation_feature.child_features: - # Additional information here, what else? - # Assume attribute is "additional_information_of_plan_regulation" - # NOTE: Could additional information be attribute of plan regulation instead of child feature? - - # Add header if not added yet - if not self.additional_information_header: - self.additional_information_header = QLabel("Lisätiedot") - self.additional_information_header.setFont(self.bold_font) - self.additonal_information_col = self.plan_regulation_grid_layout.columnCount() + 1 - self.plan_regulation_grid_layout.addWidget( - self.additional_information_header, 0, self.additonal_information_col - ) - - # TBD: Multiple additional feature per plan regulation - for attribute in child.attributes: - # Assume "type_of_additional_information_id" - additional_information_label = QLabel(attribute.display()) - self.plan_regulation_grid_layout.addWidget( - additional_information_label, row, self.additonal_information_col - ) + def set_group_heading(self): + for attribute_config in self.feature.attributes: + if attribute_config.attribute == "name": + self.heading.setText(attribute_config.display()) + + def add_plan_regulation_widgets(self): + if self.feature.child_features is not None: + for child in self.feature.child_features: + if child.layer == "plan_requlation": + self.add_plan_regulation_widget(child) + + def add_plan_regulation_widget(self, plan_regulation_feature: Feature): + plan_regulation_widget = PlanRegulationWidget(plan_regulation_feature) + self.frame.layout().addWidget(plan_regulation_widget) diff --git a/arho_feature_template/gui/plan_regulation_group_widget.ui b/arho_feature_template/gui/plan_regulation_group_widget.ui index d7a965c..9fcd557 100644 --- a/arho_feature_template/gui/plan_regulation_group_widget.ui +++ b/arho_feature_template/gui/plan_regulation_group_widget.ui @@ -6,191 +6,76 @@ 0 0 - 582 - 195 + 514 + 65 + + + 0 + 0 + + Form - - - - - - - - 0 - 0 - - - - Otsikko: - - - - - - - - 0 - 0 - - - - - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - - - - - - - - - 0 - 0 - - - - - 30 - 16777215 - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Maximum - - - - 40 - 20 - - - - - - + - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - - - - false - - - false - - + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + - - - - - - 0 - 0 - - - - - 175 - 0 - - - - - 175 - 16777215 - - - - - 75 - true - - - - Kaavamääräyslaji - - - - + + + + 0 + 0 + + + + + + - - - Qt::Horizontal + + + + 0 + 0 + - + - 0 - 20 + 30 + 16777215 - + + + + - - - + + + - - - QgsCollapsibleGroupBox - QGroupBox -
qgscollapsiblegroupbox.h
- 1 -
-
diff --git a/arho_feature_template/gui/plan_regulation_group_widget_old.ui b/arho_feature_template/gui/plan_regulation_group_widget_old.ui new file mode 100644 index 0000000..d7a965c --- /dev/null +++ b/arho_feature_template/gui/plan_regulation_group_widget_old.ui @@ -0,0 +1,196 @@ + + + plan_regulation_group_form + + + + 0 + 0 + 582 + 195 + + + + Form + + + + + + + + + 0 + 0 + + + + Otsikko: + + + + + + + + 0 + 0 + + + + + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + + + + + + + + + 0 + 0 + + + + + 30 + 16777215 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Maximum + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + + + false + + + false + + + + + + + + + 0 + 0 + + + + + 175 + 0 + + + + + 175 + 16777215 + + + + + 75 + true + + + + Kaavamääräyslaji + + + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + + + + + + + QgsCollapsibleGroupBox + QGroupBox +
qgscollapsiblegroupbox.h
+ 1 +
+
+ + +
diff --git a/arho_feature_template/gui/plan_regulation_widget.py b/arho_feature_template/gui/plan_regulation_widget.py new file mode 100644 index 0000000..4f113d0 --- /dev/null +++ b/arho_feature_template/gui/plan_regulation_widget.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from importlib import resources +from typing import TYPE_CHECKING + +from qgis.PyQt import uic +from qgis.PyQt.QtGui import QIcon +from qgis.PyQt.QtWidgets import ( + QComboBox, + QHBoxLayout, + QLabel, + QLineEdit, + QPlainTextEdit, + QPushButton, + QSizePolicy, + QToolButton, + QWidget, +) + +from arho_feature_template.qgis_plugin_tools.tools.resources import plugin_path + +if TYPE_CHECKING: + from qgis.PyQt.QtWidgets import QFormLayout + + from arho_feature_template.core.template_library_config import Feature + +ui_path = resources.files(__package__) / "plan_regulation_widget.ui" +FormClass, _ = uic.loadUiType(ui_path) + + +class PlanRegulationWidget(QWidget, FormClass): # type: ignore + """A widget representation of a plan regulation group.""" + + def __init__(self, feature: Feature): + super().__init__() + self.setupUi(self) + + # TYPES + self.regulation_kind: QLineEdit + self.form_layout: QFormLayout = self.layout() + + # INITI + self.feature = feature + self.initialize_fields() + + def initialize_fields(self): + for plan_regulation_config in self.feature.attributes: + # Set regulation type / kind + if plan_regulation_config.attribute == "type_of_plan_regulation_id": + self.regulation_kind.setText(plan_regulation_config.display()) + + elif plan_regulation_config.attribute == "numeric_default": + self.add_quantity_input() + + # elif plan_regulation_config.attribute == "text???": + # self.add_text_input() + + if self.feature.child_features is None: + return + + for child in self.feature.child_features: + # Additional information here, what else? + # Assume attribute is "additional_information_of_plan_regulation" + # NOTE: Could additional information be attribute of plan regulation instead of child feature? + + # TBD: Multiple additional feature per plan regulation + for attribute in child.attributes: + # Assume "type_of_additional_information_id" + self.add_additional_information_field(attribute.display()) + + def add_additional_information_field(self, default_value: str | None = None): + label = QLabel("Lisätieto", self) + horizontal_layout = QHBoxLayout(self) + line_edit = QLineEdit(self) + if default_value: + line_edit.setText(default_value) + conf_btn = QPushButton(self) + conf_btn.setIcon(QIcon(plugin_path("resources", "icons", "settings.svg"))) + horizontal_layout.addWidget(line_edit) + horizontal_layout.addWidget(conf_btn) + self.form_layout.addRow(label, horizontal_layout) + + def add_quantity_input(self, quantity_types: list[str] | None = None): + label = QLabel("Arvo", self) + line_edit = QLineEdit(self) + if quantity_types: + quantity_types_selection = QComboBox(self) + quantity_types_selection.addItems(quantity_types) + horizontal_layout = QHBoxLayout(self) + horizontal_layout.addItem(line_edit) + horizontal_layout.addItem(quantity_types_selection) + self.form_layout.addRow(label, horizontal_layout) + else: + self.form_layout.addRow(label, line_edit) + # TODO: Input validation + + def add_text_input(self): + label = QLabel("Arvo", self) + horizontal_layout = QHBoxLayout(self) + text_edit = QPlainTextEdit(self) + text_edit.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred) + open_btn = QToolButton(self) + horizontal_layout.addWidget(text_edit) + horizontal_layout.addWidget(open_btn) + self.form_layout.addRow(label, horizontal_layout) diff --git a/arho_feature_template/gui/plan_regulation_widget.ui b/arho_feature_template/gui/plan_regulation_widget.ui new file mode 100644 index 0000000..f9ec55f --- /dev/null +++ b/arho_feature_template/gui/plan_regulation_widget.ui @@ -0,0 +1,41 @@ + + + Form + + + + 0 + 0 + 349 + 43 + + + + + 0 + 0 + + + + Form + + + + + + Kaavamääräyslaji + + + + + + + + + + + + + + + diff --git a/arho_feature_template/gui/template_attribute_form.py b/arho_feature_template/gui/template_attribute_form.py index 7b1013b..915554c 100644 --- a/arho_feature_template/gui/template_attribute_form.py +++ b/arho_feature_template/gui/template_attribute_form.py @@ -3,16 +3,18 @@ from importlib import resources from typing import TYPE_CHECKING +from qgis.core import QgsApplication, QgsFeature +from qgis.gui import QgsSpinBox from qgis.PyQt import uic from qgis.PyQt.QtWidgets import ( QDialog, QDialogButtonBox, QLineEdit, - QMenu, QPushButton, QScrollArea, QSizePolicy, QSpacerItem, + QTreeWidget, ) from arho_feature_template.gui.plan_regulation_group_widget import PlanRegulationGroupWidget @@ -22,7 +24,7 @@ from arho_feature_template.core.template_library_config import Feature, FeatureTemplate -ui_path = resources.files(__package__) / "template_attribute_form2.ui" +ui_path = resources.files(__package__) / "template_attribute_form.ui" FormClass, _ = uic.loadUiType(ui_path) @@ -40,19 +42,29 @@ def __init__(self, feature_template_config: FeatureTemplate): self.feature_vertical_boundaries: QLineEdit self.plan_regulation_group_scrollarea: QScrollArea self.plan_regulation_group_scrollarea_contents: QWidget - # self.add_plan_regulation_group_btn: QPushButton + self.plan_regulation_groups_tree: QTreeWidget + self.add_plan_regulation_group_btn: QPushButton self.button_box: QDialogButtonBox # SIGNALS self.button_box.accepted.connect(self._on_ok_clicked) + self.add_plan_regulation_group_btn.clicked.connect(self._on_add_plan_regulation_group_clicked) # INIT + self.attribute_widgets = { + "name": self.feature_name, + "description": self.feature_description, + "type_of_underground_id": self.feature_underground, + # self.feature_vertical_boundaries + } self.scroll_area_spacer = None self.available_plan_regulation_group_configs: list[Feature] = [] + self.add_plan_regulation_group_btn.setIcon(QgsApplication.getThemeIcon("mActionAdd.svg")) self.setWindowTitle(feature_template_config.name) - self.init_plan_regulation_groups(feature_template_config) - # self.init_add_plan_regulation_group_btn() + self.init_feature_attributes_from_template(feature_template_config) + self.init_plan_regulation_groups_from_template(feature_template_config) + self.init_plan_regulation_group_library() def add_spacer(self): self.scroll_area_spacer = QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding) @@ -74,20 +86,30 @@ def remove_plan_regulation_group(self, plan_regulation_group_widget: PlanRegulat self.plan_regulation_group_scrollarea_contents.layout().removeWidget(plan_regulation_group_widget) plan_regulation_group_widget.deleteLater() - def init_add_plan_regulation_group_btn(self): - menu = QMenu() - for config in self.available_plan_regulation_group_configs: - plan_regulation_group_name = "" - for attribute in config.attributes: - if attribute.attribute == "name": - plan_regulation_group_name = attribute.display() + def _on_add_plan_regulation_group_clicked(self): + selected = self.plan_regulation_groups_tree.selectedItems() + if len(selected) == 0: + # Nothing selected + return + if len(selected) > 1: + # Too many selected, but should allow selecting only 1 item at a time + return + selected_plan_regulation_group = selected[0] + print(f"Trying to add plan regulation group {selected_plan_regulation_group.text(0)}") # noqa: T201 + # self.add_plan_regulation_group() # TODO: Implement - action = menu.addAction(plan_regulation_group_name) - action.triggered.connect(lambda _, config=config: self.add_plan_regulation_group(config)) + def init_plan_regulation_group_library(self): + # Now plan regulation group tree widget/view is just static placeholder for demo + pass - self.add_plan_regulation_group_btn.setMenu(menu) + def init_feature_attributes_from_template(self, feature_template_config: FeatureTemplate): + if feature_template_config.feature.attributes is None: + return + for _attribute in feature_template_config.feature.attributes: + # TODO: TO be implemented + pass - def init_plan_regulation_groups(self, feature_template_config: FeatureTemplate): + def init_plan_regulation_groups_from_template(self, feature_template_config: FeatureTemplate): if feature_template_config.feature.child_features is None: return for child_feature in feature_template_config.feature.child_features: @@ -98,8 +120,20 @@ def init_plan_regulation_groups(self, feature_template_config: FeatureTemplate): self.available_plan_regulation_group_configs.append(child_feature) self.add_plan_regulation_group(child_feature) else: - # TODO - print(f"Encountered child feature with unrecognized layer: {child_feature.layer}") + # TODO: Implement + print(f"Encountered child feature with unrecognized layer: {child_feature.layer}") # noqa: T201 def _on_ok_clicked(self): self.accept() + + def set_feature_attributes(self, feature: QgsFeature): + for attribute, widget in self.attribute_widgets.items(): + feature.setAttribute(attribute, self._get_widget_value(widget)) + + def _get_widget_value(self, widget: QWidget) -> str | int | None: + if isinstance(widget, QLineEdit): + return widget.text() + if isinstance(widget, QgsSpinBox): + return widget.value() + return None + # TODO: Implement diff --git a/arho_feature_template/gui/template_attribute_form.ui b/arho_feature_template/gui/template_attribute_form.ui index be51e61..5ee8156 100644 --- a/arho_feature_template/gui/template_attribute_form.ui +++ b/arho_feature_template/gui/template_attribute_form.ui @@ -6,14 +6,14 @@ 0 0 - 640 - 752 + 757 + 749 Template form - + @@ -43,9 +43,6 @@ - - - @@ -56,6 +53,9 @@ + + + @@ -98,39 +98,208 @@ - - - Kaavamääräykset - - - - - - - true - - - - - 0 - 0 - 620 - 509 - - - - - + + + + + + + Lisää kaavamääräysryhmä + + + + + + + + 0 + 0 + + + + Suodata kaavamääräysryhmiä + + + true + + + true + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + QAbstractItemView::NoEditTriggers + + + QAbstractItemView::NoDragDrop + + + false + + + false + + + + 1 + + + + + Aluevaraukset + + + + Asuinrakennusten alue + + + + + Asuinkerrostalojen alue + + + + + Asuinpientalojen alue + + + + + Rivitalojen ja muiden kytkettyjen asuinrakennusten alue + + + + + Erillispientalojen alue + + + + + + Rakennusalat + + + + Kunnan tai kaupunginosas raja + + + + + Korttelialue tai korttelialueen osa + + + + + Sitovan tonttijaon mukainen tontti + + + + + Ohjeellinen tontti / rakennusala + + + + + Rakennusala + + + + + + Numeeriset ja tekstimuotoiset määräykset + + + + Kaupungin- tai kunnanosan numero + + + + + Kaupungin- tai kunnanosan nimi + + + + + Korttelin numero + + + + + Tontin tai rakennuspaikan numero + + + + + Ohjeellisen tontin tai rakennuspaikan numero + + + + + Kadun tai tien nimi + + + + + + + + + Lisää kaavamääräysryhmä + + + + + + + + + + + Kaavamääräykset + + + + + + + true + + + + + 0 + 0 + 469 + 501 + + + + + + + + + - - - - Lisää kaavamääräysryhmä - - - @@ -142,6 +311,13 @@ + + + QgsFilterLineEdit + QLineEdit +
qgsfilterlineedit.h
+
+
diff --git a/arho_feature_template/gui/template_attribute_form2.ui b/arho_feature_template/gui/template_attribute_form2.ui deleted file mode 100644 index c1fe2d3..0000000 --- a/arho_feature_template/gui/template_attribute_form2.ui +++ /dev/null @@ -1,289 +0,0 @@ - - - template_form - - - - 0 - 0 - 757 - 749 - - - - Template form - - - - - - - - Kohteen nimi - - - - - - - - - - Kohteen kuvaus - - - - - - - - - - Maanalaisuus - - - - - - - - - - Pystysuuntainen rajaus - - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 10 - - - - - - - - Qt::Horizontal - - - - - - - Qt::Vertical - - - QSizePolicy::Preferred - - - - 20 - 10 - - - - - - - - - - - - Lisää kaavamääräysryhmä - - - - - - - - 0 - 0 - - - - false - - - - 1 - - - - - Aluevaraukset - - - - Asuinrakennusten alue - - - - - Asuinkerrostalojen alue - - - - - Asuinpientalojen alue - - - - - Rivitalojen ja muiden kytkettyjen asuinrakennusten alue - - - - - Erillispientalojen alue - - - - - - Rakennusalat - - - - Kunnan tai kaupunginosas raja - - - - - Korttelialue tai korttelialueen osa - - - - - Sitovan tonttijaon mukainen tontti - - - - - Ohjeellinen tontti / rakennusala - - - - - Rakennusala - - - - - - Numeeriset ja tekstimuotoiset määräykset - - - - Kaupungin- tai kunnanosan numero - - - - - Kaupungin- tai kunnanosan nimi - - - - - Korttelin numero - - - - - Tontin tai rakennuspaikan numero - - - - - Ohjeellisen tontin tai rakennuspaikan numero - - - - - Kadun tai tien nimi - - - - - - - - - - - - - Kaavamääräykset - - - - - - - true - - - - - 0 - 0 - 469 - 502 - - - - - - - - - - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - - - button_box - rejected() - template_form - reject() - - - 414 - 729 - - - 319 - 375 - - - - - diff --git a/arho_feature_template/gui/template_attribute_form_old.ui b/arho_feature_template/gui/template_attribute_form_old.ui new file mode 100644 index 0000000..be51e61 --- /dev/null +++ b/arho_feature_template/gui/template_attribute_form_old.ui @@ -0,0 +1,164 @@ + + + template_form + + + + 0 + 0 + 640 + 752 + + + + Template form + + + + + + + + Kohteen nimi + + + + + + + + + + Kohteen kuvaus + + + + + + + + + + Maanalaisuus + + + + + + + + + + Pystysuuntainen rajaus + + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 10 + + + + + + + + Qt::Horizontal + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 10 + + + + + + + + Kaavamääräykset + + + + + + + true + + + + + 0 + 0 + 620 + 509 + + + + + + + + + + + + Lisää kaavamääräysryhmä + + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + button_box + rejected() + template_form + reject() + + + 414 + 729 + + + 319 + 375 + + + + +