HI All,
i getting a problem, when iam clicking on pushbutton(OK) the TreeWidgetItems are not adding not only that ,the mainwindow is also closing when iam clicking on push button(OK).plz go throught the below code and let me know what the mistake i had done and how to solve this issues.
// newproject window is another window ,it has some functionalities like ok and canccel PushButton and other widgets
newproject
::newproject(QWidget *parent
){
ui.setupUi(this);
connect(ui.okButton,SIGNAL(clicked()),this,SLOT(on_okButton_clicked()));
connect(ui.cancelButton,SIGNAL(clicked()),this,SLOT(close()));
}
void newproject::on_okButton_clicked()
{
//ECLogic is the other window(mainwindow)
eclogic->createMainTree();
}
// newproject window is another window ,it has some functionalities like ok and canccel PushButton and other widgets
newproject::newproject(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
connect(ui.okButton,SIGNAL(clicked()),this,SLOT(on_okButton_clicked()));
connect(ui.cancelButton,SIGNAL(clicked()),this,SLOT(close()));
}
void newproject::on_okButton_clicked()
{
//ECLogic is the other window(mainwindow)
eclogic->createMainTree();
}
To copy to clipboard, switch view to plain text mode
// ECLlogic is the main window
// below is the slot , it will work when i click on New menuitem
void ECLogic::on_action_New_triggered()
{
NewProject=new newproject(main_tab_widget);
NewProject->show();
}
void ECLogic::createMainTree()
{
//this item has to add in the treewidget
lnx->setText(0,tr("LOGIC"));
ui->treeWidget->addTopLevelItem(lnx);
}
// ECLlogic is the main window
// below is the slot , it will work when i click on New menuitem
void ECLogic::on_action_New_triggered()
{
NewProject=new newproject(main_tab_widget);
NewProject->show();
}
void ECLogic::createMainTree()
{
//this item has to add in the treewidget
QTreeWidgetItem *lnx = new QTreeWidgetItem(ui->treeWidget);
lnx->setText(0,tr("LOGIC"));
ui->treeWidget->addTopLevelItem(lnx);
}
To copy to clipboard, switch view to plain text mode
Plz understand the code and let me know further clarifications and how can i solve this problem.
Thanks & Regards,
Mkkguru.
Bookmarks