Skip to content

Commit 558198d

Browse files
committed
Add object_name parameter to DataSet dialog for customizable naming
1 parent 4a073ee commit 558198d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

guidata/dataset/datatypes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,7 @@ def edit(
15831583
apply: Callable | None = None,
15841584
wordwrap: bool = True,
15851585
size: QSize | tuple[int, int] | None = None,
1586+
object_name: str | None = None,
15861587
) -> int:
15871588
"""Open a dialog box to edit data set
15881589
@@ -1591,6 +1592,8 @@ def edit(
15911592
apply: apply callback (default is None)
15921593
wordwrap: if True, comment text is wordwrapped
15931594
size: dialog size (QSize object or integer tuple (width, height))
1595+
object_name: object name for the dialog (default is None, meaning
1596+
use class name + "Dialog")
15941597
15951598
Returns:
15961599
Dialog exit code.
@@ -1609,6 +1612,7 @@ def edit(
16091612
wordwrap=wordwrap,
16101613
size=size,
16111614
)
1615+
dlg.setObjectName(object_name or self.__class__.__name__ + "Dialog")
16121616

16131617
return exec_dialog(dlg)
16141618

0 commit comments

Comments
 (0)