[Qt-interest] Hiding rows and columns of buttons in a grid layout - segfault

Colin S. Miller no-spam-thank-you at csmiller.demon.co.uk
Sun Sep 19 12:54:04 CEST 2010


Camilo Polymeris wrote:
> Hello
> I am writing this application: emutrix.googlecode.com
> Trying to hide columns of push buttons depending on the radiobuttons
> the user checks, the application SEGFAULTs. The pushbuttons are
> organized in columns as QButtonGroups of 35 or so buttons.
> What is strange is that it doesn't always crash and I haven't been
> able to reconstruct when. Is it possible that a QButtonGroup gets
> destroyed on some event, like when all its buttons are hidden?
> At the end of this post is the relevant code. Any ideas how to fix
> this or better ways to implement visibility toggling for a large group
> of buttons is appreciated. Maybe handling the QGridLayout that
> contains all buttons?
> BTW, I want to hide certain rows too, but haven't yet started to
> implemented the code. See this screenshot to get an idea:
> http://code.google.com/p/emutrix/#Screenshot
> 
<snip>

Camilo,
if you run the code under a debugger, what is the backtrace to the SEGFAULT?

As you appear to be running under a *NIX, and assuming that this is Linux or MacOS,
could you run the code under Valgrind[1], and see if any errors are reported before
your app crashes?

HTH,
Colin S. Miller

[1] http://www.valgrind.org/



More information about the Qt-interest-old mailing list