i have a doubt in QT c++
Suppose this is the main.cpp
#include \"head.h\"
#include \"tail.h\"
int main()
{
head *head_obj = new head();
tail *ta
You connect signals and slots of instances, not of classes.
You need the address of both the receiver and the emitter objects to connect them together.
connect(button, SIGNAL(clicked()),
pointer_to_instance_of_head, SLOT(change_number()));
(assuming "button" is a pointer).
Getting that pointer is another question, but unless you don't have a good reason to do otherwise, I suggest constructing the head object in the constructor of the QWidget
you are deriving.