plc
->setText
(0,
QString("PLC %1").
arg(i
));
if(plc)
{
connect(ui
->treeWidget,
SIGNAL(itemClicked
(QTreeWidgetItem *,
int)),
this,
SLOT(plcconfig
()));
}
plcItem->setText(0, tr("CONFIGURATION"));
plc->addChild(plcItem);
cpuconfig->setText(0, tr("CPU CONFIGURATION"));
plcItem->addChild(cpuconfig);
// if(cpuconfig)
// {
// connect(ui->treeWidget,SIGNAL(itemClicked(QTreeWidgetItem *,int)),this,SLOT(showCPU()));
// }
varconfig->setText(0, tr("VARIABLE CONFIGURATION"));
plcItem->addChild(varconfig);
progconfig->setText(0, tr("PROGRAM VARIABLE CONFIGURATION"));
varconfig->addChild(progconfig);
if(varconfig)
{
connect(ui
->treeWidget,
SIGNAL(itemClicked
(QTreeWidgetItem *,
int)),
this,
SLOT(showpvc
()));
}
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()));
}
To copy to clipboard, switch view to plain text mode
void ECLogic::showpvc( )
{
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();
}
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();
}
To copy to clipboard, switch view to plain text mode
Bookmarks