Open db dialog
This commit is contained in:
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
MainWindow::MainWindow(QWidget *parent) :
|
MainWindow::MainWindow(QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
@@ -57,5 +59,8 @@ void MainWindow::openPlugin()
|
|||||||
|
|
||||||
void MainWindow::on_actionOpen_database_triggered()
|
void MainWindow::on_actionOpen_database_triggered()
|
||||||
{
|
{
|
||||||
Context::instance().openDb("/home/jony/db.db");
|
QFileDialog dialog(this);
|
||||||
|
dialog.setNameFilter(tr("Database Files (*.db)"));
|
||||||
|
dialog.setWindowTitle(tr("Open Database"));
|
||||||
|
Context::instance().openDb(dialog.getOpenFileName());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,18 +29,8 @@
|
|||||||
<enum>QTabWidget::Rounded</enum>
|
<enum>QTabWidget::Rounded</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>-1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Tab 1</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="tab_2">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Tab 2</string>
|
|
||||||
</attribute>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user