Add progress bar for indexing

This commit is contained in:
2022-04-09 14:12:41 +02:00
parent 04e2cfa290
commit 9596bfa7a8
6 changed files with 45 additions and 10 deletions
+7 -1
View File
@@ -53,6 +53,7 @@ DataBaseView::DataBaseView(Database *database, QWidget *parent) : QWidget(parent
m_tableView = new QTableView(this);
m_tableView->verticalHeader()->setDefaultSectionSize(1);
layout->addWidget(m_tableView);
connect(m_tableView, &QTableView::activated, this, &DataBaseView::itemActivated);
m_model = new QSqlQueryModel(this);
@@ -60,7 +61,7 @@ DataBaseView::DataBaseView(Database *database, QWidget *parent) : QWidget(parent
m_tableView->setModel(m_model);
m_tableView->horizontalHeader()->restoreState(settings.value("databaseview/header").toByteArray());
QHBoxLayout *hlayout = new QHBoxLayout(this);
QHBoxLayout *hlayout = new QHBoxLayout();
layout->addLayout(hlayout);
QPushButton *selectColumnsButton = new QPushButton(tr("Select columns"), this);
@@ -98,6 +99,11 @@ void DataBaseView::loadDatabase()
prepareQuery(settings.value("databaseview/selectedColumns", DEFAULT_COLUMNS).toStringList());
}
void DataBaseView::itemActivated(const QModelIndex &index)
{
emit loadFile(m_model->data(index.siblingAtColumn(0)).toString());
}
void DataBaseView::prepareQuery(const QStringList &columns)
{
QString sql = "SELECT file,";