Skip to content

Commit 2a79de5

Browse files
authored
feat: add 2d ConfigPresetsTable (#449)
* feat: add ConfigGroupsTree * starting tests * feat: 2d preset table * wip * more tests * update example * fix pyside6 * fix for tester * add two-way sync test
1 parent d26ffde commit 2a79de5

File tree

6 files changed

+574
-1
lines changed

6 files changed

+574
-1
lines changed

examples/config_presets_table.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
from pymmcore_plus import CMMCorePlus
2+
from qtpy.QtWidgets import QApplication
3+
from rich import print
4+
5+
from pymmcore_widgets.config_presets import ConfigPresetsTable
6+
7+
app = QApplication([])
8+
9+
core = CMMCorePlus()
10+
core.loadSystemConfiguration()
11+
12+
table = ConfigPresetsTable.create_from_core(core)
13+
table.setGroup("Channel")
14+
model = table.sourceModel()
15+
assert model
16+
17+
18+
@model.dataChanged.connect
19+
def _on_data_changed():
20+
print(model.get_groups()[1]) # channel group
21+
22+
23+
table.resize(800, 200)
24+
table.show()
25+
26+
app.exec()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ dev = [
8585
"mypy>=1.15.0",
8686
"pdbpp>=0.11.6 ; sys_platform != 'win32'",
8787
"pre-commit-uv >=4.1.0",
88-
"pyqt6>=6.9.0",
88+
# "pyqt6>=6.9.0",
8989
"rich>=14.0.0",
9090
"ruff>=0.11.8",
9191
"types-shapely>=2.1.0.20250512",

src/pymmcore_widgets/config_presets/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
from ._pixel_configuration_widget import PixelConfigurationWidget
66
from ._qmodel._config_model import QConfigGroupsModel
77
from ._views._config_groups_tree import ConfigGroupsTree
8+
from ._views._config_presets_table import ConfigPresetsTable
89

910
__all__ = [
1011
"ConfigGroupsTree",
12+
"ConfigPresetsTable",
1113
"GroupPresetTableWidget",
1214
"ObjectivesPixelConfigurationWidget",
1315
"PixelConfigurationWidget",

0 commit comments

Comments
 (0)