Hi! I'am sorry to my english.
Why code line
Qt Code:
  1. delete dbe;
To copy to clipboard, switch view to plain text mode 
cause for Segmentatuon fault, if this line to follow after code
Qt Code:
  1. DBEvent* dbe = new DBEvent(n,x,y);
  2. QApplication::postEvent( receiver, dbe );
  3. ...
  4. msleep(1);
  5. //delete dbe;
To copy to clipboard, switch view to plain text mode 
Аbove code from within QThread::run().

The class DBEven implementation:
Qt Code:
  1. class DBEvent : public QCustomEvent {
  2. public:
  3. DBEvent( int n_, double* px_, double* py_) :
  4. QCustomEvent( 65432 ), n(n_), px(px_), py(py_) {
  5. }
  6. ...
  7. private:
  8. int n;
  9. double *px;
  10. double *py;
  11. };
To copy to clipboard, switch view to plain text mode 

Who killed CustomEvent?

Thanks.