[SOLVED] emit crashes on QGraphicsView
-
i've added a signal in a QGraphicsView deriven class. when i call "emit" i get crashes.
can't resolve it :(EDITED: (code added)
@class editor: public QGraphicsView
{
Q_OBJECTpublic:
editor(QWidget *parent);signals:
void rectSizeChanged(int w, int h);
};@ -
That should work. Perhaps moc info has not been updated? Please clean your project, run qmake and rebuild it.
-
Weird. Perhaps you are running a threaded application? Maybe the signal is sent to some thread with a DirectCall instead of a Qt::QueuedConnection?
-
Hi,
To add to sierdzio, are you sure it's not on the receiver's end that the crash happens (thinking of a direct connection) ?
-
@SGalst: yeah ;)
@slerdzlo: you were right. actually that "emit" was called within a function which was controlled from another friend class of "QGraphicsItem". i didn't care about the thready work of QGraphicsView and the scenes inside it.
so i moved signals into the graphics item class and added a getter function to the graphics view which returns a pointer to that graphics item. now, main widget will get signals directly from the graphics item.
thank you very much.