mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Ensemble: Edit: Display current selected target data.
This commit is contained in:
1 parent
5f64499984
commit
98d30a326e
2 files changed
+15
-2
No files matched your search
@@ -86,12 +86,14 @@ class EnsembleEditDialog(PamhyrDialog):
|
|||||||
self._ensemble = ensemble
|
self._ensemble = ensemble
|
||||||
self._target_data = None
|
self._target_data = None
|
||||||
|
|
||||||
|
self._tree = self.find(QTreeWidget, "treeWidget_target_data")
|
||||||
|
self._tg_group_box = self.find(QGroupBox, "groupBox_target_data")
|
||||||
|
|
||||||
self._init_tree()
|
self._init_tree()
|
||||||
self._init_default_values()
|
self._init_default_values()
|
||||||
self._init_connection()
|
self._init_connection()
|
||||||
|
|
||||||
def _init_tree(self):
|
def _init_tree(self):
|
||||||
self._tree = self.find(QTreeWidget, "treeWidget_target_data")
|
|
||||||
self._tree.setColumnCount(1)
|
self._tree.setColumnCount(1)
|
||||||
self._tree.setHeaderLabels(["Name"])
|
self._tree.setHeaderLabels(["Name"])
|
||||||
|
|
||||||
@@ -107,6 +109,10 @@ class EnsembleEditDialog(PamhyrDialog):
|
|||||||
self._ensemble.target_data
|
self._ensemble.target_data
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self._tg_group_box.setTitle(
|
||||||
|
self._format_target_data(self._target_data)
|
||||||
|
)
|
||||||
|
|
||||||
item = stricklers.find_item_by_value(self._target_data)
|
item = stricklers.find_item_by_value(self._target_data)
|
||||||
if item:
|
if item:
|
||||||
self._tree.setCurrentItem(item)
|
self._tree.setCurrentItem(item)
|
||||||
@@ -142,6 +148,13 @@ class EnsembleEditDialog(PamhyrDialog):
|
|||||||
if type(item) is StricklersCoefModelItem:
|
if type(item) is StricklersCoefModelItem:
|
||||||
self._target_data = item.get_value()
|
self._target_data = item.get_value()
|
||||||
|
|
||||||
|
self._tg_group_box.setTitle(
|
||||||
|
self._format_target_data(self._target_data)
|
||||||
|
)
|
||||||
|
|
||||||
|
def _format_target_data(self, data):
|
||||||
|
return f" Selection: {str(data[1])}, {data[0]}"
|
||||||
|
|
||||||
def update_distribution(self, txt):
|
def update_distribution(self, txt):
|
||||||
# txt = self.get_combobox_text("comboBox_distribution")
|
# txt = self.get_combobox_text("comboBox_distribution")
|
||||||
distribution = next(
|
distribution = next(
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" rowspan="2" colspan="2">
|
<item row="1" column="0" rowspan="2" colspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_target_data">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Target data</string>
|
<string>Target data</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Reference in new issue
Block a user