i have a getting problem related to Qtreewidgetitem signals ,when iam using the below code the entire treewidget items getting the connections so i need to get the connectionns to particular item..plz go through the code and mention the changes has to be done..

QTreeWidgetItem *plc = new QTreeWidgetItem(ui->treeWidget);
plc->setText(0,QString("PLC %1").arg(i));

if(plc)
{
connect(ui->treeWidget,SIGNAL(itemClicked(QTreeWidgetItem *,int)),this,SLOT(plcconfig()));
}

QTreeWidgetItem *plcItem = new QTreeWidgetItem(plc);
plcItem->setText(0, tr("CONFIGURATION"));
plc->addChild(plcItem);

QTreeWidgetItem *cpuconfig = new QTreeWidgetItem(plcItem);
cpuconfig->setText(0, tr("CPU CONFIGURATION"));
plcItem->addChild(cpuconfig);

// if(cpuconfig)
// {
// connect(ui->treeWidget,SIGNAL(itemClicked(QTreeWidgetItem *,int)),this,SLOT(showCPU()));
// }

QTreeWidgetItem *varconfig = new QTreeWidgetItem(plcItem);
varconfig->setText(0, tr("VARIABLE CONFIGURATION"));
plcItem->addChild(varconfig);

QTreeWidgetItem *progconfig = new QTreeWidgetItem(varconfig);
progconfig->setText(0, tr("PROGRAM VARIABLE CONFIGURATION"));
varconfig->addChild(progconfig);

if(varconfig)
{
connect(ui->treeWidget,SIGNAL(itemClicked(QTreeWidgetItem *,int)),this,SLOT(showpvc()));
}

As iam using above signal when iam cliicking on PROGRAM VARIABLE CONF..... the required window has to opened as below.

void ECLogic::showpvc( )
{
QTabBar *tab_4=new QTabBar(ui->widgetConf);
PCD= new programvariableconfiguration(tab_4);
PCD->setWindowTitle(QString("PVC"));
tabwidget3->insertTab(0,tab_4,QString("PVC"));
tab_4->setCurrentIndex(tabwidget3->indexOf(ui->widgetConf));
tab_4->setTabsClosable(true);
tab_4->setEnabled(true);
PCD->show();
}

but my problem is getting the connections to all the treewidggetitems not for the particular....is there any way to get my condtion ....so please suggests me the way to write the code........