BaseDialog

Author:Neil Wallace (neil@openmolar.com)

A customised version of QDialog which has an apply and cancel button, and an accesible layout.

methods and attributes

class lib_openmolar.common.qt4.dialogs.base_dialog.BaseDialog(parent=None, remove_stretch=False)[source]

Bases: PyQt4.QtGui.QDialog

A base class for all my dialogs provides a button box with ok and cancel buttons, slots connected to accept and reject has a VBoxlayout - accessed by self.layout

__init__(parent=None, remove_stretch=False)[source]
enableApply(enable=True)[source]

call this to enable the apply button (which is disabled by default)

get_confirm(message, accept='ok', reject='cancel', default='accept')[source]

a convenience function to raise a dialog for confirmation of an action

insertWidget(widg)[source]

insert widget at the bottom of the layout

minimumSizeHint()[source]

Overwrite this function inherited from QWidget

remove_spacer()[source]

If this is called, then the spacer added at init is removed. sometimes the spacer mucks up dialogs

set_accept_button_text(text)[source]

by default, the text here is “apply”... change as required using this function

set_check_on_cancel(check)[source]

if true, then user will be asked if changes should be abandoned if the dialog is rejected, and given the opportunity to continue

set_reject_button_text(text)[source]

by default, the text here is “cancel”... change as required using this function

sizeHint()[source]

Overwrite this function inherited from QWidget

Table Of Contents

Previous topic

Advisor

Next topic

BaseMainWindow