Python Forum
PyQt5 : Interpreter Crashes While Initializing Message Box
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyQt5 : Interpreter Crashes While Initializing Message Box
#6
Exec is part of Python 3 built-functions. The message box appears in blank "except" condition. This is bad practice as it will catch everything and may hide other errors. Try narrowing the problem down by removing some part of your code. For instance, does it still crash like this?

def connectDB():
    msg = QtWidgets.QMessageBox(3, "Warning", "Please check the internet connection", QtWidgets.QMessageBox.Ok)
    msg.exec_()
Prehaps the dialog is collected by the garbage collector? Try to bind "msg" to "self" so the object persist after the loop.
Reply


Messages In This Thread
RE: PyQt5 : Interpreter Crashes While Initializing Message Box - by Alfalfa - Aug-23-2019, 02:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  GUI crashes flash77 3 971 Jul-26-2023, 05:09 PM
Last Post: flash77
  [Tkinter] Clicking on the button crashes the TK window ODOshmockenberg 1 2,284 Mar-10-2022, 05:18 PM
Last Post: deanhystad
  [PyQt] App crashes when reopening a subwindow JayCee 13 5,178 Aug-04-2021, 01:51 AM
Last Post: JayCee
  [PyGUI] My GUI crashes after command MLGpotato 1 1,927 Feb-21-2021, 03:17 PM
Last Post: deanhystad
  [PyQt] PyQT5 Thread crashes after a while Suresh 0 2,014 Jul-21-2020, 07:53 AM
Last Post: Suresh
  Huge code problems (buttons(PyQt5),PyQt5 Threads, Windows etc) ZenWoR 0 2,863 Apr-06-2019, 11:15 PM
Last Post: ZenWoR

Forum Jump:

User Panel Messages

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