PDA

View Full Version : Crashing without debug mode- No crashing with gdb debugger



sujan.dasmahapatra
7th February 2011, 10:07
Dear All
I am facing some problem in implementing a QScrollArea. I subclassed it and created a buttin on this as below.

CScrollArea::CScrollArea() {
printbutton = new QPushButton("Save As Image",this);
printbutton->setGeometry(actual_page_width + coordx-100,coordy,100,25);
connect(printbutton,SIGNAL(clicked()),this,SLOT(go toprinter()));
}

the problem is that when I am trying show this scrollarea through menu click its crashing. and crashing at the first line
printbutton = new QPushButton("Save As Image",this);

but when I am debugging this through gdb debugger then its running fine and at the end i can see the scroll are with button.

Why is happening like this. Any idea from anyone would be highly appreciate.
Also when I try to set a window title like
setWindowTitle("My Page");
its again crashing.
Thanks in advance for any help. sujan

franz
7th February 2011, 11:27
Give us a compiling example reproducing the problem. It may clarify things.

Also, did you try a full rebuild?

Added after 4 minutes:

You may also have to check if this actually exists. When attaching a debugger values are initialized differently.