summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Staerk <dev@staerk.de>2011-11-10 09:40:58 (GMT)
committerThorsten Staerk <dev@staerk.de>2011-11-10 09:40:58 (GMT)
commit23d2202b0e7aca8999928374746da5733712ebc8 (patch)
tree61f7bb8a886079577337268420811f804c8146f1
parent0584cc0a100f6493794d9f79d35d3ba62d0a15ea (diff)
adding sqlite example that works (as opposed to qt example)
-rw-r--r--ical/event/main.cpp3
-rw-r--r--kicons/mainwindow.cpp5
-rw-r--r--kicons/mainwindow.h1
-rw-r--r--sqlite/main.cpp17
-rw-r--r--sqlite/sqlite.pro7
5 files changed, 33 insertions, 0 deletions
diff --git a/ical/event/main.cpp b/ical/event/main.cpp
index d2231ca..777eb3d 100644
--- a/ical/event/main.cpp
+++ b/ical/event/main.cpp
@@ -15,6 +15,7 @@ This is a test case for KDE's iCalendar functionality.
int main (int argc, char *argv[])
{
const QByteArray& ba=QByteArray("test");
+ delete (void *)0;
const KLocalizedString name=ki18n("myName");
KAboutData aboutData( ba, ba, name, ba, name);
KCmdLineArgs::init( argc, argv, &aboutData );
@@ -29,6 +30,8 @@ int main (int argc, char *argv[])
cal->addTodo(todo1);
KCal::Event* event1 = new KCal::Event();
event1->setRelatedTo(todo1);
+ event1->setDtStart(KDateTime::currentLocalDateTime());
+ event1->setDtEnd(KDateTime::currentLocalDateTime());
cal->addEvent(event1);
KABC::Lock *lock = cal->lock();
cal->save();
diff --git a/kicons/mainwindow.cpp b/kicons/mainwindow.cpp
index 928c4c2..1e3918a 100644
--- a/kicons/mainwindow.cpp
+++ b/kicons/mainwindow.cpp
@@ -13,6 +13,7 @@ MainWindow::MainWindow(QWidget *parent)
setCentralWidget(textArea);
setupActions();
+ testint();
}
void MainWindow::setupActions()
@@ -31,4 +32,8 @@ void MainWindow::setupActions()
setupGUI();
}
+QString MainWindow::testint()
+{
+ int i=5;
+}
diff --git a/kicons/mainwindow.h b/kicons/mainwindow.h
index d787505..91ae79e 100644
--- a/kicons/mainwindow.h
+++ b/kicons/mainwindow.h
@@ -12,6 +12,7 @@ class MainWindow : public KXmlGuiWindow
private:
KTextEdit* textArea;
void setupActions();
+ QString testint();
};
#endif
diff --git a/sqlite/main.cpp b/sqlite/main.cpp
new file mode 100644
index 0000000..a58acdb
--- /dev/null
+++ b/sqlite/main.cpp
@@ -0,0 +1,17 @@
+#include <QtSql>
+
+int main(int argc, char *argv[])
+{
+ QSqlDatabase db;
+ db = QSqlDatabase::addDatabase("QSQLITE");
+ db.setDatabaseName("sqlite.dat");
+
+ if (db.open())
+ qDebug() << "success";
+ else
+ qDebug() << "failed";
+ QSqlQuery query;
+ query.exec("create table stocks(id int primary key, name varchar(20))");
+ db.commit();
+ db.close();
+}
diff --git a/sqlite/sqlite.pro b/sqlite/sqlite.pro
new file mode 100644
index 0000000..c0f7579
--- /dev/null
+++ b/sqlite/sqlite.pro
@@ -0,0 +1,7 @@
+QT += sql
+
+TARGET = sqlite
+TEMPLATE = app
+
+SOURCES += main.cpp
+