Add progress bar for indexing
This commit is contained in:
+7
-1
@@ -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,";
|
||||
|
||||
Reference in New Issue
Block a user