I am new to this and I just don't understand how to set that up.
Here is what I have now. But everytime I select a new row it crashes.
MainWindow
::MainWindow(QWidget *parent
){
ui->setupUi(this);
wrkTable = dbgmgr.OpenDB("moz_downloads","","downloads.sqlite");
if (wrkTable)
{
ui->tableView->setModel(wrkTable);
ui->tableView->show();
ui->tableView->setSelectionModel(&sm);
dbgmgr.DebugInfo(true);
}
else
qDebug() << "Error: " << dbgmgr.error;
}
{
qDebug() << "Row Moved! ";
}
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow)
{
ui->setupUi(this);
wrkTable = dbgmgr.OpenDB("moz_downloads","","downloads.sqlite");
if (wrkTable)
{
connect(wrkTable, SIGNAL(dataChanged(QModelIndex, QModelIndex)),
this, SLOT(rowMoved(QModelIndex, QModelIndex)));
ui->tableView->setModel(wrkTable);
ui->tableView->show();
QItemSelectionModel sm(wrkTable);
ui->tableView->setSelectionModel(&sm);
dbgmgr.DebugInfo(true);
}
else
qDebug() << "Error: " << dbgmgr.error;
}
void MainWindow::rowMoved(QModelIndex tl,QModelIndex br)
{
qDebug() << "Row Moved! ";
}
To copy to clipboard, switch view to plain text mode
I got it!
Thanks
Bookmarks