Skip to content

Commit d6d6095

Browse files
committed
Implement DockWidget
1 parent b3361f1 commit d6d6095

File tree

5 files changed

+89
-41
lines changed

5 files changed

+89
-41
lines changed

arho_feature_template/gui/panels/__init__.py

Whitespace-only changes.

arho_feature_template/gui/panels/template_library_panel.py

-22
This file was deleted.

arho_feature_template/gui/panels/template_library_panel.ui

-19
This file was deleted.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from importlib import resources
2+
from typing import TYPE_CHECKING
3+
4+
from qgis.gui import QgsDockWidget
5+
from qgis.PyQt import uic
6+
7+
if TYPE_CHECKING:
8+
from qgis.gui import QgsFilterLineEdit
9+
from qgis.PyQt.QtWidgets import QComboBox, QLabel, QListView
10+
11+
ui_path = resources.files(__package__) / "template_dock.ui"
12+
DockClass, _ = uic.loadUiType(ui_path)
13+
14+
15+
class TemplateLibraryDock(QgsDockWidget, DockClass): # type: ignore
16+
library_selection: "QComboBox"
17+
search_box: "QgsFilterLineEdit"
18+
template_list: "QListView"
19+
txt_tip: "QLabel"
20+
21+
def __init__(self):
22+
super().__init__()
23+
self.setupUi(self)
24+
25+
self.search_box.setShowSearchIcon(True)
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>FeatureTemplater</class>
4+
<widget class="QDockWidget" name="FeatureTemplater">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>309</width>
10+
<height>502</height>
11+
</rect>
12+
</property>
13+
<property name="allowedAreas">
14+
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
15+
</property>
16+
<property name="windowTitle">
17+
<string>Feature Templates</string>
18+
</property>
19+
<widget class="QWidget" name="dockWidgetContents">
20+
<layout class="QVBoxLayout" name="verticalLayout">
21+
<property name="spacing">
22+
<number>0</number>
23+
</property>
24+
<property name="leftMargin">
25+
<number>0</number>
26+
</property>
27+
<property name="topMargin">
28+
<number>0</number>
29+
</property>
30+
<property name="rightMargin">
31+
<number>0</number>
32+
</property>
33+
<property name="bottomMargin">
34+
<number>0</number>
35+
</property>
36+
<item>
37+
<widget class="QComboBox" name="library_selection"/>
38+
</item>
39+
<item>
40+
<widget class="QgsFilterLineEdit" name="search_box"/>
41+
</item>
42+
<item>
43+
<widget class="QListView" name="template_list"/>
44+
</item>
45+
<item>
46+
<widget class="QLabel" name="txt_tip">
47+
<property name="text">
48+
<string>TextLabel</string>
49+
</property>
50+
</widget>
51+
</item>
52+
</layout>
53+
</widget>
54+
</widget>
55+
<customwidgets>
56+
<customwidget>
57+
<class>QgsFilterLineEdit</class>
58+
<extends>QLineEdit</extends>
59+
<header>qgis.gui</header>
60+
</customwidget>
61+
</customwidgets>
62+
<resources/>
63+
<connections/>
64+
</ui>

0 commit comments

Comments
 (0)