Python Forum
[PyQt] error message
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyQt] error message
#1
hi everybody
I have created an GUI with the QT designer and when i integrate it in the python IDE ( Pycharm or Visuel Studio)
I encounter the following error message " RuntimeError: You can't initialize an object twice!" and I can't understand what's the problem
please help me
the source code :
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.uic import loadUiType
from Custom_Widgets.Widgets import *
from PySide2.QtWidgets import *
import os
import sys
MainUi,_ =loadUiType('interface.ui')

class Main(QMainWindow, MainUi):
    def __init__(self,parent=None):
        super(Main, self).__init__(parent)
        QMainWindow.__init__(self)
        self.setupUi(self)
        loadJsonStyle(self, self.ui)

def main ():
    app=QApplication(sys.argv)
    window= Main()
    window.show()
    app.exec_()

if __name__ == "__main__":
    main()
Reply


Messages In This Thread
error message - by the_wolf_dz - Oct-23-2022, 10:09 AM
RE: error message - by Yoriz - Oct-23-2022, 10:25 AM
RE: error message - by the_wolf_dz - Oct-24-2022, 10:01 AM
RE: error message - by the_wolf_dz - Oct-24-2022, 10:36 AM
RE: error message - by deanhystad - Oct-24-2022, 07:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Error message box and quit app Kumarkv 1 2,257 May-19-2020, 07:05 PM
Last Post: Larz60+
  [Tkinter] How to make message box error stay on top of window scratchmyhead 1 8,318 May-10-2020, 10:21 PM
Last Post: scratchmyhead
  [PyQt] No reaction and no error message when clicking button Atalanttore 4 4,837 Nov-23-2018, 01:48 PM
Last Post: Atalanttore
  [PyQt] error message in pyqt pro red_man_008 8 7,377 Aug-13-2017, 08:50 PM
Last Post: red_man_008

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020