Hi. I'm new here, and new to Qt.
I have app which uses sqlite database to store it's data. What I want to do is open a new window with table editor, when i select an option from menu in the main window. Honestly I don't know how to do it. I tired to create a new function in my main window which would call the editor, but this doesn't seems to work.
void MainWindow::editTableTrucchi() {
qDebug() << "Table Editor for table trucchi Evoked";
TableEditor editor("trucchi");
editor.show();
}
void MainWindow::editTableTrucchi() {
qDebug() << "Table Editor for table trucchi Evoked";
TableEditor editor("trucchi");
editor.show();
}
To copy to clipboard, switch view to plain text mode
This funciton is called from QAction
editTableTrucchiAct
= new QAction(tr
("Trucchi"),
this);
connect(editTableTrucchiAct, SIGNAL(triggered()), this, SLOT(editTableTrucchi()));
editTableTrucchiAct = new QAction(tr("Trucchi"), this);
connect(editTableTrucchiAct, SIGNAL(triggered()), this, SLOT(editTableTrucchi()));
To copy to clipboard, switch view to plain text mode
Like this it doesn't work.
I'd like to know how to do it properly.
You can view whole code here: http://code.google.com/p/neurohelper/source/browse/?r=3
Edit: resolved it myself. Instead of calling the TableEditor like i did before it shold be called like this:
void MainWindow::editTableTrucchi() {
qDebug() << "Table Editor for table trucchi Evoked";
TableEditor *editor = new TableEditor("trucchi");
editor -> show();
}
void MainWindow::editTableTrucchi() {
qDebug() << "Table Editor for table trucchi Evoked";
TableEditor *editor = new TableEditor("trucchi");
editor -> show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks