From d5b2d37aa29f96ef23d62afba2ecb4dd004c8cb6 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Thu, 21 May 2015 18:01:38 -0300 Subject: Added (non-functional) file dialog for opening files. --- main.cpp | 4 ++-- main_view.qml | 12 +++++++++++- pm.pro | 2 +- 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 #include #include -#include +#include #include #include "mp.h" @@ -10,7 +10,7 @@ int main(int argc, char **argv) { - QGuiApplication app(argc, argv); + QApplication app(argc, argv); qmlRegisterType("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 -- cgit v1.2.3