BaseDialog

class cgp_generic_utils.qt.BaseDialog(title, label, size=None, parent=None, isFrameless=False, orientation=None)

Bases: PySide2.QtWidgets.QDialog

basic dialog with ok and cancel button

contentLayout()

the content layout

Returns:the content layout
Return type:PySide2.QtWidgets.QBoxLayout
isValid()

check if the dialog is valid

Returns:True it is valid - False it is not valid
Return type:bool
load()

load base dialog

Returns:cancel : self.rejection - ok : self.validation
Return type:any
rejection()

result of the dialog when cancel is pressed

Returns:the rejection of the dialog
Return type:any
setCancelButton(text=None)

set the text of the cancel button

Parameters:text (str) – text to set on the cancel button
setOkButton(text=None)

set the text ok the ok button

Parameters:text (str) – text to set on the ok button
setSize(size)

set the size of the dialog

Parameters:size (list[int]) – values of the width and the height [width - height]
setStatus(okEnabled=True)

set the status of the ok button

Parameters:okEnabled (bool) – True : the ok button is enabled - False the ok button is disabled
validation()

result of the dialog when ok is pressed

Returns:the validation of the dialog
Return type:any