Hello guest, if you read this it means you are not registered. Click here to register in a few simple steps, you will enjoy all features of our Forum.
Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Closing Modal Window in QT

 I create a modal dialog in PyQT5 in this way:

from PyQt5 import QtCore, QtGui, QtWidgets

class FirmUi_Dialog(object):

   def setupUi(self, Dialog):
       Dialog.resize(311, 300)
       self.groupBox = QtWidgets.QGroupBox(Dialog)
       self.saveFirmPB = QtWidgets.QPushButton(Dialog)
       self.saveFirmPB.setGeometry(QtCore.QRect(140, 240, 75, 23))
       self.cancelPB = QtWidgets.QPushButton(Dialog)
       self.cancelPB.setGeometry(QtCore.QRect(220, 240, 75, 23))


   def saveFirmToDB(self):

   def closeFirmDialog(self):
      pass  #How I can close the Dialog (Modal Window)
            self.close() #doesn't work 
to open the dialog in the Mainwindow, I create the following function:

def showFirmaDialog(self):
   firmDialog = QtWidgets.QDialog()
   ui = FirmUi_Dialog()
This steps works fine. But I dont' find a way to trigger the close event for this dialog when I push the cancelPB 



Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to stop a tkinter function, without closing the window? keakins 5 257 Jun-29-2017, 11:53 AM
Last Post: keakins
  update a variable in parent window after closing its toplevel window gray 5 473 Mar-20-2017, 10:35 PM
Last Post: Larz60+
  GTK main window calling a main window DennisT 4 802 Oct-19-2016, 09:36 PM
Last Post: DennisT

Forum Jump:

Users browsing this thread: 1 Guest(s)