How do those widget draw themselves?
Here is a brief description:
//Inside the Main widget's paintEvent:
painter.begin( graficoPaintDevice );
//drawing
assex = new AsseNumerico (/*options*/,painter,this);
assex.draw();
painter.end();
//stucture of the second widget
public:
AsseNumerico(....);
private:
};
void AsseNumerico::draw(Qpainter &painter){
p.drawSomething();
}
//Inside the Main widget's paintEvent:
QPainter painter;
painter.begin( graficoPaintDevice );
//drawing
assex = new AsseNumerico (/*options*/,painter,this);
assex.draw();
painter.end();
//stucture of the second widget
class AsseNumerico,public QWidget{
public:
AsseNumerico(....);
void draw(QPainter &painter);
private:
QPainter p;
};
AsseNumerico::AsseNumerico(/*options*/,QPainter &painter,QWidget *parent):QWidget(parent),p(painter){};
void AsseNumerico::draw(Qpainter &painter){
p.drawSomething();
}
To copy to clipboard, switch view to plain text mode
Make sure you compile your application in debug mode (you should have "CONFIG += debug" in .pro file). Then run your application from gdb. When is crashes issue "bt" command to print the backtrace and post it here.
Well, first. I will explain better and briefly how the program works. I do some calculation to draw an istogram on screen and afterward I give the opportunity to print it.
If I display the istogram on screen WITHOUT trying to print it I got the the error:
*** glibc detected *** double free or corruption (!prev): 0x0825f648 ***
And, if i use the file in the .ps and then use dvipdf I got the error:
/usr/bin/dvipdf: line 40: 28347 Broken pipe exec dvips -q -f "$infile"
28348 Segmentation fault | gs $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
Segmentation fault
And this is the ouput from gdb:
*** glibc detected *** double free or corruption (!prev): 0x08252e38 ***
Program received signal SIGABRT, Aborted.
[Switching to Thread -1221314880 (LWP 31932)]
0xffffe410 in ?? ()
(gdb) bt
#0 0xffffe410 in ?? ()
#1 0xbfffed94 in ?? ()
#2 0x00000006 in ?? ()
#3 0x00007cbc in ?? ()
#4 0xb738c6e5 in raise () from /lib/tls/libc.so.6
#5 0xb738e049 in abort () from /lib/tls/libc.so.6
#6 0xb73c07ba in __fsetlocking () from /lib/tls/libc.so.6
#7 0xb73c6d9c in malloc_trim () from /lib/tls/libc.so.6
#8 0xb73c737a in free () from /lib/tls/libc.so.6
#9 0xb756a6f1 in operator delete () from /usr/lib/libstdc++.so.6
#10 0xb7bca5d7 in ~QPainterPrivate (this=0x82644b0) at qpainter_p.h:120
#11 0xb7bbe78a in ~QPainter (this=0x819629c) at painting/qpainter.cpp:635
#12 0x08081a4b in ~AsseRiferimento (this=0x8196238) at .moc/moc_assenumerico.cpp:77
Bookmarks