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
  [Tkinter] No menu bar in window bde69 5 187 Nov-25-2017, 06:35 PM
Last Post: heiner55
  [Tkinter] Window unresponsive when executed. fawazcode 2 188 Sep-11-2017, 12:29 AM
Last Post: Larz60+
  Need help sizing a window Larz60+ 0 258 Jul-05-2017, 07:06 PM
Last Post: Larz60+
  How to stop a tkinter function, without closing the window? keakins 5 670 Jun-29-2017, 11:53 AM
Last Post: keakins
  update a variable in parent window after closing its toplevel window gray 5 832 Mar-20-2017, 10:35 PM
Last Post: Larz60+
  Show second window using classes iFunKtion 2 581 Feb-10-2017, 12:50 PM
Last Post: iFunKtion
  using qt with classes basic window iFunKtion 0 447 Feb-06-2017, 09:50 AM
Last Post: iFunKtion
  GTK main window calling a main window DennisT 4 1,142 Oct-19-2016, 09:36 PM
Last Post: DennisT
  Hide command window sparkz_alot 8 1,703 Sep-29-2016, 10:14 AM
Last Post: wavic

Forum Jump:

Users browsing this thread: 1 Guest(s)