I have an PyQt app were I need one of the windows to be able to be
opened more than one at a time. When I try to open it I only get one
instance at the same time. The main class is the QWidget() class with a
QGridLayout() displaying the various window components.
Is there a certain flag I need to set or different constructor I need
to use to allow the window to be opened more than one at a time?
Here's a brief snippet of the code that displays the window:
def new_showing(sel f):
""" This method creates a new contact showing record. """
if self.flag == 'KNOWN':
try:
test_contact = self.entry_id
except:
QMessageBox.war ning(self, "Qt CRAM", "There is no
contact record loaded.\nPlease select a contact record first.")
return
self.new_show_w idget=QWidget()
self.new_show_w idget.resize(24 0, 280)
self.new_show_w idget.setCaptio n('Qt CRAM - Contact Showings')
# Define the Qt layout to be used for the window.
self.new_show_g rid=QGridLayout (self.new_show_ widget, 8, 2)
# bunch of widgets displaying stuff
self.new_show_w idget.show()
opened more than one at a time. When I try to open it I only get one
instance at the same time. The main class is the QWidget() class with a
QGridLayout() displaying the various window components.
Is there a certain flag I need to set or different constructor I need
to use to allow the window to be opened more than one at a time?
Here's a brief snippet of the code that displays the window:
def new_showing(sel f):
""" This method creates a new contact showing record. """
if self.flag == 'KNOWN':
try:
test_contact = self.entry_id
except:
QMessageBox.war ning(self, "Qt CRAM", "There is no
contact record loaded.\nPlease select a contact record first.")
return
self.new_show_w idget=QWidget()
self.new_show_w idget.resize(24 0, 280)
self.new_show_w idget.setCaptio n('Qt CRAM - Contact Showings')
# Define the Qt layout to be used for the window.
self.new_show_g rid=QGridLayout (self.new_show_ widget, 8, 2)
# bunch of widgets displaying stuff
self.new_show_w idget.show()
Comment