dragon
22nd July 2011, 16:33
Hello anyone,
Iám using Qt 4.7 on Windows XP.
Iám using QtCreator.
I have made severall applications with no problems at all.
I have a mainwindow with a dialog.
I call the dialog wich contains a QTableWidget with items.
I want to return item value from the table and put the the value into the mainwindow lineEdit.
My problem is that when i execute the dialog through a pushbutton the dialog appears but when i click on the ok pushbutton on the dialog it hangs and doesn't return to the mainwindow.
Mainwindow.cpp
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->matvoorPb, SIGNAL(clicked()), this, SLOT(test()));
etc....
}
void MainWindow::test(){
matDialog dlg(this);
if(dlg.exec() == QDialog::Accepted){
item = new QTableWidgetItem();
item = dlg.matTable->currentItem();
QString mat = item->text();
ui->matvoorLe->setText(mat);
}
}
Thanks in advance.
Iám using Qt 4.7 on Windows XP.
Iám using QtCreator.
I have made severall applications with no problems at all.
I have a mainwindow with a dialog.
I call the dialog wich contains a QTableWidget with items.
I want to return item value from the table and put the the value into the mainwindow lineEdit.
My problem is that when i execute the dialog through a pushbutton the dialog appears but when i click on the ok pushbutton on the dialog it hangs and doesn't return to the mainwindow.
Mainwindow.cpp
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->matvoorPb, SIGNAL(clicked()), this, SLOT(test()));
etc....
}
void MainWindow::test(){
matDialog dlg(this);
if(dlg.exec() == QDialog::Accepted){
item = new QTableWidgetItem();
item = dlg.matTable->currentItem();
QString mat = item->text();
ui->matvoorLe->setText(mat);
}
}
Thanks in advance.