Results 1 to 8 of 8

Thread: Delete and re-create Qt Designer generated widgets

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2015
    Posts
    52
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Delete and re-create Qt Designer generated widgets

    I inherited a program that was initiated by command-line and I have to turn it into a project-based program, where you have a Open project on the menu and so on.

    I've moved everything from the QMainWindow constructor to a loadProject function.

    Now the problem arises when the user loads a project when there was already one opened. The items allocated in the heap by the mainwindow will be reasigned and therefore we have a memory leak. I can take care of the project data, but I have many graphic items allocated in the heap with a hierarchy of centralWidget->layout->scene->items and centralWidget->layout->items

    I've thought I can delete the central widget so I get rid of everything, but it's an autogenerated object located in ui_mainwindow.h. How can I reset it or rebuild it so I can assign it again once I delete it? Does anything I say make sense? Any other better approaches?
    Last edited by quimnuss; 20th August 2015 at 12:01.

Similar Threads

  1. Replies: 0
    Last Post: 16th July 2011, 05:37
  2. Replies: 2
    Last Post: 30th March 2011, 20:20
  3. Replies: 2
    Last Post: 28th May 2010, 15:26
  4. Delete objects in Designer
    By Krish_ng in forum Qt Programming
    Replies: 3
    Last Post: 7th August 2007, 10:42
  5. How to create pop up widgets in designer.
    By gsQT4 in forum Qt Tools
    Replies: 1
    Last Post: 25th May 2006, 16:40

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.