Results 1 to 5 of 5

Thread: How can a delete a widget after it emits a signal

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2016
    Location
    Florida, US
    Posts
    27
    Qt products
    Qt5
    Platforms
    Unix/X11
    Thanks
    7

    Default Re: How can a delete a widget after it emits a signal

    Thank you.

    Sigh.... when I was first reading about QT5 I read about deleteLater(), and then promptly purged it from my memory. Yes, that solves the actual abort issue. And if I had a memory myself wouldn't have troubled you. Thank you for the patience.

    I'm less sure if it helps with memory, as the structure of the program is invoking a new set of widgets that cache images, and it won't return to the event loop until those are all created and the first ones displayed.

    Though, to be fair, I'm still struggling to see how much memory any of this is really using, I think I need to spend some time on that issue before working too hard to fix a problem that might not be significant. What I did (while waiting for this solution) was do a setRowCount(0) on the QTableWidget, and hope that gave back memory, instead of deleting it.

    Are there any good dynamic analysis tools that can instrument QT-specific programs to provide a view at runtime (during development) of object usage, object size, leaks, etc.? I know of some C++ tools for memory leaks of course, but wondered if there is anything more QT specific, that might also do things like indicate widget ownership nesting (or un-owned), sizing, visibility, etc? Or build-time options for QT itself (I am building QT from source) that adds some instrumentation.

    I ask because about half the time when I spend a lot of time doing something manually I find there's an object or method already there I just missed.

    So your signature line, Santosh, is very apt.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: How can a delete a widget after it emits a signal

    Usually the C++ tools are very applicable as the Qt specific things are similar to situations with a shared pointer.

    But you could check if GammaRay has a plugin for that as it knows and tracks an application's QObject instances.
    If it does not it might not be too difficult to write on.

    Cheers,
    _

  3. The following user says thank you to anda_skoa for this useful post:

    Linwood (11th March 2017)

Similar Threads

  1. when QBuffer emits readyRead signal?
    By mastupristi in forum Qt Programming
    Replies: 5
    Last Post: 5th April 2016, 22:09
  2. Replies: 4
    Last Post: 25th September 2014, 16:21
  3. Passing pointer to object that emits a signal
    By Gadgetman53 in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2011, 22:04
  4. Replies: 3
    Last Post: 2nd April 2011, 14:13
  5. Replies: 4
    Last Post: 23rd January 2011, 11:08

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
  •  
Qt is a trademark of The Qt Company.