summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-03-04 12:59:32 +0000
committerandreas <andreas@daaaf23c-2e50-4459-9457-1e69db5a47bf>2014-03-04 12:59:32 +0000
commitc543117ff43c63a053ea786ed606398ac4687494 (patch)
treebf13926dff41782831fbf5fc37c274f09f7a0360 /src/main.cpp
added source code
git-svn-id: file:///var/local/svn/basicwriter@12 daaaf23c-2e50-4459-9457-1e69db5a47bf
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..efe3031
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,36 @@
+#include <gui/notepad.hpp>
+#include <QApplication>
+#include <QFile>
+#include <QIODevice>
+#include <QXmlStreamReader>
+
+#include <vector>
+#include <iostream>
+
+int main(int argc, char *argv[])
+{
+ QApplication a(argc, argv);
+ Notepad w;
+ w.show();
+
+ // Open the file given as first argument
+/* QFile file(argv[1]);
+ if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ std::cout << "Error while opening file " << argv[1] << std::endl;
+ return 1;
+ }
+
+ // Read all tags using the xml stream reader
+ QXmlStreamReader xml(&file);
+
+ while (!xml.atEnd()) {
+ xml.readNext();
+ }
+ if (xml.hasError()) {
+ std::cout << "Error while parsing XML: " << xml.errorString().toStdString() << " at line " << xml.lineNumber() << std::endl;
+ return 1;
+ }
+ return 0;*/
+
+ return a.exec();
+}