hello, i'm trying to build an application which can dynamically load and destroy pages with in the app. but I'm having problems rendering loaded pages properly.
i have attached some screen shots to show what i mean.
i first open the application which has the page loaded in the middle with some tab widgets and lineeditors and a tableView. then i press the delete page button which destroys the widget containing all the aforementioned parts and then i press add page which is meant to create the page again in memory, but i now does not render the page properly. I've done this in pyqt and this it the code for the add page function and delete page function.
def SearchAndAddCustomer(self):
//this is the new object from the class which creates the search customer widget and all its contents
self.SearchAndAdd = customerSearch(self)
// this is the widget which holds the search customer widget on the main app back (the dark grey area) which is a Stacked widget called doubleContent
self.mainApplicationStack = centralHolder2(self)
// layout onto the dark grey area
self.
mainApplicationStackLayout = QGridLayout (self.
mainApplicationStack.
centralCanvas)
self.mainApplicationStackLayout.addWidget(self.SearchAndAdd)
self.mainApplicationStackLayout.setContentsMargins(0,0,0,0)
self.mainApplicationStackLayout.setSpacing(0)
//add the pages to the stack widget
self.doubleContent.insertWidget(0,self.mainApplicationStack)
def SearchAndAddCustomerDelete(self):
self.SearchAndAdd.destroy()
self.doubleContent.removeWidget(self.mainApplicationStack)
self.mainApplicationStack.destroy()
def SearchAndAddCustomer(self):
//this is the new object from the class which creates the search customer widget and all its contents
self.SearchAndAdd = customerSearch(self)
// this is the widget which holds the search customer widget on the main app back (the dark grey area) which is a Stacked widget called doubleContent
self.mainApplicationStack = centralHolder2(self)
// layout onto the dark grey area
self.mainApplicationStackLayout = QGridLayout (self.mainApplicationStack.centralCanvas)
self.mainApplicationStackLayout.addWidget(self.SearchAndAdd)
self.mainApplicationStackLayout.setContentsMargins(0,0,0,0)
self.mainApplicationStackLayout.setSpacing(0)
//add the pages to the stack widget
self.doubleContent.insertWidget(0,self.mainApplicationStack)
def SearchAndAddCustomerDelete(self):
self.SearchAndAdd.destroy()
self.doubleContent.removeWidget(self.mainApplicationStack)
self.mainApplicationStack.destroy()
To copy to clipboard, switch view to plain text mode
how can i render a page properly which is not in memory at the start of the application?
I'm i missing some thing?
you input on this will be very grateful
Bookmarks