Skip to content
  • 0 Votes
    12 Posts
    2k Views
    T

    @Christian-Ehrlicher said in How avoid memory leak with GUI programming:

    @TheEnigmist said in How avoid memory leak with GUI programming:

    VS points to p = p.scaled line that add every time 10k byte of data (50x50x4 bytes), and each time I create and detroy the widget where that QAbstractTableModel is I see in memory that all that Pixmap are never destroyed.

    There is no leak and can't be one - you should take a look into QPixmapCache and for the sake of performance and implicit sharing don't load the pixmap in your data() method every time.

    Yeah I just found out that I was really wrong with that :( I will fix it right now!
    So I can go over when see pixmap in my allocated memory due to QPixmapCache. Ofc is always better to improve my code and don't load so many times a pixmap!

    @Chris-Kawa said in How avoid memory leak with GUI programming:

    @TheEnigmist said in How avoid memory leak with GUI programming:

    So if I'm not wrong what is cached is not the file on disk, but its scaled version

    No. How would Qt know that it's the same pixmap? What's cached is the pixmap that you create from a file, and the path (with some additional info) becomes a key to look it up in the cache.

    I see, but why the debugger points me to the scaled() function when looking for the allocated memory istance?

  • 0 Votes
    8 Posts
    2k Views
    M

    @jsulm @mrjj @ig Thanks for all the help.
    I was able to fix the inheritance issue by creating a new FileMenu instance in the main window.

  • 0 Votes
    2 Posts
    581 Views
    K

    I haven’t come across anything that fits your needs exactly. But there is this software I found (MD Python). It definitely fits your needs of making GUIs faster, easier and more interacted. It uses drag and drop to place GUI element that are premade. You can generate all of this into python code if you want to add your own flair or speciality. The link for the software is https://labdeck.com/python/ , however it offers a limited amount of GUI components. The other one (MD Python Designer) is around $10-20 and it’s got unlimited GUI use (here’s the link https://labdeck.com/python-designer/ ). I think you’ll find the Python GUI Designer link more useful (https://labdeck.com/python/python-gui-designer/) as it shows the Designer in more depth. Slightly off-topic but they also have a GUI Designer that uses their own code, and from what I can gather it’s similar to C++ code and looks to need less lines of code but it’s not really my style, maybe it interests you: here’s the link for it https://labdeck.com/gui-designer/ .