mirror of https://gitlab.com/pamhyr/pamhyr2
keep selection after meshing
parent
f6e08f203c
commit
bc4557e21f
|
|
@ -180,8 +180,6 @@ class MeshingDialog(PamhyrDialog):
|
||||||
# self._begin_dir = self.get_combobox_text("comboBox_begin_gl")
|
# self._begin_dir = self.get_combobox_text("comboBox_begin_gl")
|
||||||
# self._end_dir = self.get_combobox_text("comboBox_end_gl")
|
# self._end_dir = self.get_combobox_text("comboBox_end_gl")
|
||||||
|
|
||||||
self.parent.tableView.selectionModel().clearSelection()
|
|
||||||
|
|
||||||
super().accept()
|
super().accept()
|
||||||
|
|
||||||
def reject(self):
|
def reject(self):
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ from PyQt5.QtGui import (
|
||||||
from PyQt5.QtCore import (
|
from PyQt5.QtCore import (
|
||||||
QModelIndex, Qt, QSettings, pyqtSlot,
|
QModelIndex, Qt, QSettings, pyqtSlot,
|
||||||
QItemSelectionModel, QCoreApplication, QSize,
|
QItemSelectionModel, QCoreApplication, QSize,
|
||||||
|
QItemSelection, QItemSelectionRange,
|
||||||
)
|
)
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QApplication, QMainWindow, QFileDialog, QCheckBox,
|
QApplication, QMainWindow, QFileDialog, QCheckBox,
|
||||||
|
|
@ -286,6 +287,13 @@ class GeometryWindow(PamhyrWindow):
|
||||||
self.tableView.model().blockSignals(False)
|
self.tableView.model().blockSignals(False)
|
||||||
|
|
||||||
def edit_meshing(self):
|
def edit_meshing(self):
|
||||||
|
|
||||||
|
rows = list(
|
||||||
|
set(
|
||||||
|
(i.row() for i in self.tableView.selectedIndexes())
|
||||||
|
)
|
||||||
|
)
|
||||||
|
selected_rk = [self._reach.profile(r).rk for r in rows]
|
||||||
try:
|
try:
|
||||||
dlg = MeshingDialog(
|
dlg = MeshingDialog(
|
||||||
reach=self._reach,
|
reach=self._reach,
|
||||||
|
|
@ -303,6 +311,23 @@ class GeometryWindow(PamhyrWindow):
|
||||||
logger_exception(e)
|
logger_exception(e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
ind = []
|
||||||
|
for i in range(self._reach.number_profiles):
|
||||||
|
if self._reach.profile(i).rk in selected_rk:
|
||||||
|
ind.append(i)
|
||||||
|
self.tableView.setFocus()
|
||||||
|
selection = self.tableView.selectionModel()
|
||||||
|
index = QItemSelection()
|
||||||
|
if len(ind) > 0:
|
||||||
|
for i in ind:
|
||||||
|
index.append(QItemSelectionRange(self.tableView.model().index(i, 0)))
|
||||||
|
selection.select(
|
||||||
|
index,
|
||||||
|
QItemSelectionModel.Rows |
|
||||||
|
QItemSelectionModel.ClearAndSelect |
|
||||||
|
QItemSelectionModel.Select
|
||||||
|
)
|
||||||
|
|
||||||
def _edit_meshing(self, data):
|
def _edit_meshing(self, data):
|
||||||
try:
|
try:
|
||||||
mesher = InternalMeshing()
|
mesher = InternalMeshing()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue