[Qt-interest] Problem with QHash and QThread

Andrei Sebastian Cîmpean andreiamenta at gmail.com
Wed Jun 15 00:43:06 CEST 2011


Hello everybody,

I have stumbled upon a problem that I don't quite understand and I was hoping 
someone can help me get to the bottom of it.
I have a class that inherits QThread. In the header file I have:

inline uint qHash(const QPoint& p)
{
    return qHash(p.x()+p.y());
}
struct Hexagon{
    QPoint center;
    int centerSSD;
    QHash<QPoint,int> points;
};
class HexagonalSearch : public QThread, public BlockMatching
{
    Q_OBJECT
(...)

, with BlockMatching being a simple class that just has some functions preset.
It compiles without any warnings, although I know that's not necessarily a 
condition for no problems.
When I run the app and it gets to part where it has to execute the run() 
function the app crashes. I can't debug using Qt Creator (don't know why it 
freezes at setting breakpoints even after reinstall) but when I run the 
debugger it instantly crashes with the message "The inferior stopped ...." -> 
Segmentation fault, and it displays assembly code with a flag set for a 
compare (cmpq).
I have attached a screenshot with the result.
Any help would be greatly appreciated and would probably save my life.

Thank you for your time and patience,
Andrei Sebastian Cîmpean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshotqtpr.png
Type: image/png
Size: 160403 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110615/b36ebcf1/attachment.png 
-------------- 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/20110615/b36ebcf1/attachment.bin 


More information about the Qt-interest-old mailing list