[Qt-interest] Problem with passing QPixmap pointer to thread (cannot debug)

Andrei Sebastian Cîmpean andreiamenta at gmail.com
Sun Jun 12 23:26:14 CEST 2011


Hello everybody,

I have a problem and I hope I can find the answer here.
First of all, I cannot use the debugger of Qt Creator (don't know why, it 
freezes after a while, no matter what project I load).
The problem however is this:
I have a class called FullSearch that inherits QThread and BlockMatching.
In BlockMatching I have two protected variables : 
    QPixmap* firstFrame;
    QPixmap* secondFrame;
, that I set with:
void BlockMatching::setFirstFrame(QPixmap *Frame){
    this->firstFrame = Frame;
    this->firstFrameIsSet = true;
}
void BlockMatching::setSecondFrame(QPixmap *Frame){
    this->secondFrame = Frame;
    this->secondFrameIsSet = true;
}.
I load images with:
        this->images << new QPixmap(files.at(i));
However, when I do this in the MainWindow class, inside the run action 
handler:
    this->fullSearch->setFirstFrame(this->images.at(0));
    this->fullSearch->setSecondFrame(this->images.at(1));
, the application crashes with this message "The program has unexpectedly 
finished.". This is supposed to set the pixmaps I use in my thread that 
calculates some block matching. Unfortunately it crashes at the point where it 
sets the first pointer.
I tried several things and one time even used a QString as parametre with 
which I would create new QImage objects but I got the same result.
I am certain I may made a mistake and I'm sort of a newby with C++ and I could 
use some help.

Thanks,
Andrei
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110613/6d0a16c3/attachment.bin 


More information about the Qt-interest-old mailing list