I have a QTabWidget, and two classes, display1 and display2, are two tab members. I want to transfer some data, say a bool flag, between these two tabs:

Qt Code:
  1. tabWidget = new QTabWidget;
  2. display1 = new Display1 ();
  3. display2= new Display2()
  4. tabWidget->addTab(display1 , tr("Online"));
  5. tabWidget->addTab(display2, tr("Offline"));
  6.  
  7. connect(Display1, SIGNAL(sendout(bool)), Display2, SLOT(receive(bool)));
To copy to clipboard, switch view to plain text mode 

In class Display1.h:
Qt Code:
  1. signals:
  2. void sendout(bool flag);
To copy to clipboard, switch view to plain text mode 

In class Display1.cpp, one of its methods does this:
Qt Code:
  1. bool flag = true;
  2. emit sendout(flag);
To copy to clipboard, switch view to plain text mode 

In class Display2.h:
Qt Code:
  1. public slots:
  2. void receive(bool flag);
To copy to clipboard, switch view to plain text mode 

In class Display2.cpp:
Qt Code:
  1. void Display2::receive(bool flag)
  2. {
  3. printf("I got one message. \n");
  4. }
To copy to clipboard, switch view to plain text mode 

I got LINK ERROR:
Error 6 error LNK2001: unresolved external symbol "protected: void __thiscall Display1::sendout(bool)" (?sendout@Display1@@IAEX_N@Z) Display1.obj

I have no idea where is the problem....Can anyone help me? Thanks