summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt4
-rw-r--r--dependencies.txt6
-rw-r--r--src/main.cpp29
3 files changed, 25 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 062d224..4a1a3e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ PROJECT(basicwriter)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
SET(CMAKE_AUTOMOC ON)
-FIND_PACKAGE(Qt5Widgets REQUIRED)
+FIND_PACKAGE(Qt5Core REQUIRED)
# Option for enabling testing. Turn on with 'cmake -Dtest=ON'.
OPTION(test "Build all tests." OFF) # Makes boolean 'test' available.
@@ -83,7 +83,7 @@ TARGET_LINK_LIBRARIES(ousia_xml
)
# Link the ousia xml model against the core module of Qt5
-QT5_USE_MODULES(ousia_xml Core)
+QT5_USE_MODULES(ousia_xml Core Script)
# Definition of the main program
ADD_EXECUTABLE(ousia
diff --git a/dependencies.txt b/dependencies.txt
new file mode 100644
index 0000000..1939fef
--- /dev/null
+++ b/dependencies.txt
@@ -0,0 +1,6 @@
+The following packages have to be installed (for Fedora)
+
+- cmake
+- qt5-qtbase-devel
+- qt5-qtscript-devel
+
diff --git a/src/main.cpp b/src/main.cpp
index 6e3457c..3603b9c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2,6 +2,8 @@
#include <QFile>
#include <QIODevice>
#include <QXmlStreamReader>
+#include <QScriptEngine>
+#include <QDebug>
#include <vector>
#include <iostream>
@@ -12,24 +14,27 @@ using namespace ousia::xml;
int main(int argc, char *argv[])
{
+ QScriptEngine engine;
+ qDebug() << "JS Test: " << engine.evaluate("Test");
+
// Open the file given as first argument
- if (argc < 2) {
- std::cout << "No filename specified!" << std::endl;
- return 1;
- }
+// if (argc < 2) {
+// std::cout << "No filename specified!" << std::endl;
+// return 1;
+// }
- QFile file(argv[1]);
- if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
- std::cout << "Error while opening file " << argv[1] << std::endl;
- return 1;
- }
+// QFile file(argv[1]);
+// if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+// std::cout << "Error while opening file " << argv[1] << std::endl;
+// return 1;
+// }
// Create the QXmlStreamReader instance
- QXmlStreamReader xml(&file);
+// QXmlStreamReader xml(&file);
// Pass it to the XmlReader
- XmlReader xmlReader(xml);
- xmlReader.process();
+// XmlReader xmlReader(xml);
+// xmlReader.process();
return 0;
}