1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| class GenericWindow(QtGui.QWidget):
"""
Fenêtre générique.
"""
def __init__(self, app_obj, parent_widget, window_name, window_flags=None):
if not window_flags is None:
QtGui.QWidget.__init__(self, parent_widget, window_flags)
else:
QtGui.QWidget.__init__(self, parent_widget)
...
class VideoPlayer(QtGui.QFrame, GenericWindow):
"""
Frame contenant un lecteur vidéo.
"""
def __init__(self, app_obj, parent_widget, widget_name):
QtGui.QFrame.__init__(self, parent_widget)
GenericWindow.__init__(self, app_obj, parent_widget, widget_name)
...
class MainWindow(QtGui.QMainWindow, GenericWindow):
"""
Fenêtre personnalisée.
"""
def __init__(self, app_obj, parent_widget, window_name, window_flags=0):
QtGui.QMainWindow.__init__(self, parent_widget, window_flags)
GenericWindow.__init__(self, app_obj, parent_widget, window_name)
...
class Dialog(QtGui.QDialog, GenericWindow):
"""
Fenêtre personnalisée.
"""
def __init__(self, app_obj, parent_widget, window_name, window_flags=0):
QtGui.QDialog.__init__(self, parent_widget, window_flags)
GenericWindow.__init__(self, app_obj, parent_widget, window_name)
... |
Partager