aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-05-21 18:01:38 -0300
committerSamuel Fadel <samuelfadel@gmail.com>2015-05-21 18:01:38 -0300
commita12b317f441241c1eae3cac1e8b03d210859be90 (patch)
tree99392c7d840def1f52c9bd813d639c75294fd7f9
parent9706895943dcef136c67ebdaea4c01bfc81ce5d1 (diff)
Added (non-functional) file dialog for opening files.
-rw-r--r--main.cpp4
-rw-r--r--main_view.qml12
-rw-r--r--pm.pro2
3 files changed, 14 insertions, 4 deletions
diff --git a/main.cpp b/main.cpp
index 380d311..0f7f8c8 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,7 +1,7 @@
#include <cmath>
#include <memory>
#include <QSurfaceFormat>
-#include <QGuiApplication>
+#include <QApplication>
#include <QQmlApplicationEngine>
#include "mp.h"
@@ -10,7 +10,7 @@
int main(int argc, char **argv)
{
- QGuiApplication app(argc, argv);
+ QApplication app(argc, argv);
qmlRegisterType<Scatterplot>("PM", 1, 0, "Scatterplot");
diff --git a/main_view.qml b/main_view.qml
index 4a093f2..5d86c36 100644
--- a/main_view.qml
+++ b/main_view.qml
@@ -1,8 +1,10 @@
import QtQuick 2.0
import QtQuick.Controls 1.3
+import QtQuick.Dialogs 1.2
import PM 1.0
ApplicationWindow {
+ title: "Projection Manipulation"
visible: true
width: 1200
height: 600
@@ -59,6 +61,14 @@ ApplicationWindow {
}
}
+ FileDialog {
+ id: fileDialog
+ title: "Choose a file..."
+ onAccepted: {
+ // datasetLoader.load(fileDialog.fileUrls)
+ }
+ }
+
Action {
id: quitAction
text: "&Quit"
@@ -70,7 +80,7 @@ ApplicationWindow {
id: openAction
text: "&Open..."
shortcut: "Ctrl+O"
- onTriggered: console.log("Open file")
+ onTriggered: fileDialog.open()
}
Action {
diff --git a/pm.pro b/pm.pro
index 0d0f153..9608b89 100644
--- a/pm.pro
+++ b/pm.pro
@@ -1,4 +1,4 @@
-QT += qml quick
+QT += qml quick widgets
QMAKE_CXXFLAGS += -std=c++11
QMAKE_LIBS += -larmadillo