yes,you are all right. now I found a solution way. USED a static variable to record this address,then call non-static member function of the class.JUST LIKE THAT.
//mythread.h
1 static unsigned long classAddress;
2 class myclass: public QThread
3 {
Q_Object
4 private:
5 static void myfuntion(); // callback function
6 protected:
7 void run();
8 static void emitMsg( unsigned long user_value,char * filename)
9 {
10 myclass* pthis = (myclass*)user_value; // get this address
11 pthis->emit storescpProgressInfo(filename) ;
12 }
13 signals:
14 void storescpProgressInfo(char * filename);
15 }
//mythread.cpp
16 void myclass::myfuntion(char * filename)
17 {
18 classAddress =(unsigned long)this ;
19 emitMsg(classAddress,filename);
20 }
//main.cpp
21 frmmainWindow::frmmainWindow()
22 {
23 myclass my;
24 connect(&my,SIGNAL(storescpProgressInfo(char *)),this,SLOT(myslot(char *)));
25 }
the myclass can emit the signal,
but frmmainwindow cannot receive the SIGNAL and not load the myslot function, what's wrong ? can you help ?
Bookmarks