[Qt-interest] Adding widget to QGraphicsView
Srdjan Todorovic
todorovic.s at googlemail.com
Wed Jul 22 16:23:55 CEST 2009
Hi,
On 22/07/2009, John McClurkin <jwm at nei.nih.gov> wrote:
> The compiler went to Qlineedit.h 268? I assume you mean that the
> debugger went to qlineedit.h 268. If this is a stack trace, then this
> line just the last entry of the trace. Since this is a Qt src file, I
> double strongly that the error is here.
The error is probably not there, but that's where it's manifested.
eg.
char buf[4];
QWidget yay;
::memset(&buff, 0, 60);
yay.show(); // bang!
The debugger will probably catch yay's members as the cause of the
crash (eg you set an internal pointer to NULL or some other invalid
value).
But it was actually the size param to memset() that is the error.
(I'm sure you all know this ;) )
> The error was triggered by your
> code. You need to examine the stack trace to find the entries that
> identify your code. That said, I would guess that, since the debugger
> stops in qlineedit.h, you are using an invalid pointer to a QLineEdit
> widget.
Let me also add "use the debugger and get a stack trace".
All you need to do is:
gdb ./myprogram
run
bt
So simple, yet so important.
Good luck,
Srdjan
More information about the Qt-interest-old
mailing list