Hi there ,

I have a QThread which is worker thread that supllying some data to QGLWidget. I made a signal completed on QThread. I wanna connect that signal with QGLWidget its DrawME Slot is it posssible to connect these Object with this way ?

Qt Code:
  1. class myThread : public QThread
  2. {
  3. public:
  4. myThread(MainWindow *that) : QThread(0) {
  5. m_MW = that; // i'm getting MainThread with that way i guess it's not good way ....
  6. }
  7.  
  8. void run()
  9. {
  10. ...
  11. ...
  12. BYTE *pDib = (BYTE *)m_MW->myImage->imageData;
  13. int w = m_MW->myImage->width;
  14. int h = m_MW->myImage->height;
  15. emit (completed(pDib,w,h));
  16. }
  17.  
  18. signals:
  19. void completed(BYTE *, int, int){}
  20.  
  21. private :
  22. MainWindow *m_MW;
  23. };
To copy to clipboard, switch view to plain text mode 

GLWidget

Qt Code:
  1. class GLWidget : public QGLWidget
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. GLWidget(QWidget *parent = 0);
  7. void setTextureData(BYTE *data, int width, int height);
  8.  
  9. public slots:
  10. void DrawME(BYTE * data, int width, int height);
  11.  
  12. private:
  13. void initializeGL();
  14. void resizeGL(int w, int h);
  15. GLuint m_pTextureId;
  16. };
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. myThread *t = new myThread(this);
  2. QObject::connect(t, SIGNAL(completed(BYTE*,int,int)), ui->widget, SLOT(DrawME(BYTE*,int,int)));
  3. t->start();
To copy to clipboard, switch view to plain text mode 

after t->start it works well signal is emitting but Slot DrawMe is not working , Could you gimme right way for connection slot and signals , thanks for help