From 2883e9a758d604f40a0eba24e50b97b4a07cfdc2 2012-02-21 06:00:24 From: Marek Rosa Date: 2012-02-21 06:00:24 Subject: [PATCH] Copy database to bin directory --- diff --git a/example/gdpbarchart/gdpbarchart.pro b/example/gdpbarchart/gdpbarchart.pro index ea9227a..73231c1 100644 --- a/example/gdpbarchart/gdpbarchart.pro +++ b/example/gdpbarchart/gdpbarchart.pro @@ -21,3 +21,11 @@ SOURCES += main.cpp\ widget.cpp HEADERS += widget.h + +COPY_DATABASE_COMMAND = "cp gdpData $$CHART_BUILD_BIN_DIR/gdpData" + +win32:{ + COPY_DATABASE_COMMAND = $$replace(COPY_DATABASE_COMMAND, "/","\\") +} + +QMAKE_POST_LINK = $$COPY_DATABASE_COMMAND diff --git a/example/gdpbarchart/widget.cpp b/example/gdpbarchart/widget.cpp index a75c702..9023d46 100644 --- a/example/gdpbarchart/widget.cpp +++ b/example/gdpbarchart/widget.cpp @@ -22,7 +22,7 @@ QTCOMMERCIALCHART_USE_NAMESPACE Widget::Widget(QWidget *parent) : QWidget(parent) { - setGeometry(100, 100, 800, 600); + setGeometry(100, 100, 1000, 600); // right panel layout countrieslist = new QListWidget; @@ -54,7 +54,7 @@ Widget::Widget(QWidget *parent) // connect to the database db = QSqlDatabase::addDatabase("QSQLITE"); - db.setDatabaseName("../example/gdpbarchart/gdpData"); + db.setDatabaseName("gdpData"); if(!db.open()) { qDebug() << "could not open database. SQLite db file missing (?)";