diff options
author | Samuel Fadel <samuelfadel@gmail.com> | 2015-05-21 18:01:38 -0300 |
---|---|---|
committer | Samuel Fadel <samuelfadel@gmail.com> | 2015-05-21 18:01:38 -0300 |
commit | a12b317f441241c1eae3cac1e8b03d210859be90 (patch) | |
tree | 99392c7d840def1f52c9bd813d639c75294fd7f9 | |
parent | 9706895943dcef136c67ebdaea4c01bfc81ce5d1 (diff) |
Added (non-functional) file dialog for opening files.
-rw-r--r-- | main.cpp | 4 | ||||
-rw-r--r-- | main_view.qml | 12 | ||||
-rw-r--r-- | pm.pro | 2 |
3 files changed, 14 insertions, 4 deletions
@@ -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 { @@ -1,4 +1,4 @@ -QT += qml quick +QT += qml quick widgets QMAKE_CXXFLAGS += -std=c++11 QMAKE_LIBS += -larmadillo |