Results 1 to 4 of 4

Thread: Creating And Destoying composite Widgets

  1. #1

    Default Creating And Destoying composite Widgets

    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.

    Qt Code:
    1. def SearchAndAddCustomer(self):
    2. //this is the new object from the class which creates the search customer widget and all its contents
    3. self.SearchAndAdd = customerSearch(self)
    4. // 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
    5. self.mainApplicationStack = centralHolder2(self)
    6. // layout onto the dark grey area
    7. self.mainApplicationStackLayout = QGridLayout (self.mainApplicationStack.centralCanvas)
    8.  
    9. self.mainApplicationStackLayout.addWidget(self.SearchAndAdd)
    10. self.mainApplicationStackLayout.setContentsMargins(0,0,0,0)
    11. self.mainApplicationStackLayout.setSpacing(0)
    12. //add the pages to the stack widget
    13. self.doubleContent.insertWidget(0,self.mainApplicationStack)
    14.  
    15.  
    16. def SearchAndAddCustomerDelete(self):
    17. self.SearchAndAdd.destroy()
    18. self.doubleContent.removeWidget(self.mainApplicationStack)
    19. 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
    Attached Images Attached Images
    Last edited by morraine; 30th August 2008 at 10:53.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Creating And Destoying composite Widgets

    What is wrong exactly? Those screenshots don't say anything by themselves.

  3. #3

    Default Re: Creating And Destoying composite Widgets

    i thought the screen shot was obvious that there is some thing wrong.

    Basically in the first screen shot then application is first loaded with the middle page from the start.
    then i activate a function to delete the central page which in screen shot 2 you will see the middle nit is now gone and it is a dark grey background.
    then i activate a function to load it again and the page does not render properly. the table view scroll bar wont work the combobox has gone but for a little square and the tab widgets back grounds have disappeared letting the dark grey through.

    basically when i destroy and load the page again it does not render like it should like how it renders the first time when the application is loaded .

    do you know why this is happening?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Creating And Destoying composite Widgets

    Do you use layouts while creating those pages?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.