diff --git a/application/mainwindow.cpp b/application/mainwindow.cpp index fffed1e..faee5ec 100644 --- a/application/mainwindow.cpp +++ b/application/mainwindow.cpp @@ -5,6 +5,8 @@ #include #include +#include +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -56,5 +58,8 @@ void MainWindow::openPlugin() void MainWindow::on_actionOpen_database_triggered() { - Context::instance().openDb("D:/prac/prodejna.db"); + QFileDialog dialog(this); + dialog.setNameFilter(tr("Database Files (*.db)")); + dialog.setWindowTitle(tr("Open Database")); + Context::instance().openDb(dialog.getOpenFileName()); } diff --git a/application/mainwindow.ui b/application/mainwindow.ui index 7b13053..7552bc0 100644 --- a/application/mainwindow.ui +++ b/application/mainwindow.ui @@ -29,18 +29,8 @@ QTabWidget::Rounded - 0 + -1 - - - Tab 1 - - - - - Tab 2 - -