joyeux noel à tous. je rencontre un problème pour ouvrir une fenetre avec un QAction d'un QMenubar d'un QMainindow.
dans mon code simplifié ci dessous, quand je clique sur l'action inscription une fenetre instance de MySavingForm devrait s'ouvrir
mais c'est pas le cas.
La fenetre apparait puis disparait très rapidement sans qu'on ne puisse voir quelque chose. Quelqu'un pourrait il m'aider à comprendre ce qui se passe ? merci

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
38
39
40
41
42
43
44
import sys
from PyQt5 import QtCore, QtGui, QtWidgets
from phonebook_class import Ui_MainWindow
from centralwidget_class import Ui_centralWidgetForm
from savings_class import Ui_savingForm
import os.path
import sqlite3
from PyQt5.QtWidgets import QMessageBox
#############################################################################################"
 
class MySavingForm(QtWidgets.QWidget, Ui_savingForm):
    def __init__(self,*args,parent = None, **kwargs):
        super().__init__(*args,**kwargs)
        self.parent = parent
        self.setupUi(self)
        self.show()
 
class MyCentralWidget(QtWidgets.QWidget, Ui_centralWidgetForm):
    def __init__(self,*args,parent = None, **kwargs):
        super().__init__(*args,**kwargs)
        self.parent = parent
        self.setupUi(self)
        #self.table.resize(1500, 500)
 
class MyMainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
    def __init__(self,*args,parent = None, **kwargs):
        super().__init__(*args,**kwargs)
        self.parent = parent
        self.setupUi(self)
 
        central_widget = MyCentralWidget(self)
        self.setCentralWidget(central_widget)
 
        self.actionInscription.triggered.connect(self.showSavingForm)
 
    def showSavingForm(self):
        MySavingForm()
 
if __name__=="__main__":
 
 app = QtWidgets.QApplication(sys.argv)
 fen = MyMainWindow()
 fen.show()
 app.exec()