From 5704ed78ffcdf414ab577b4bfe8edbd33f270f27 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 20 Jan 2015 13:14:12 -0800 Subject: [PATCH] add a working menu to interface to jump to address --- gvr-interface/CMakeLists.txt | 1 - gvr-interface/src/GVRInterface.cpp | 4 +--- gvr-interface/src/GVRMainWindow.cpp | 31 +++++++++++++++++++++++++++++ gvr-interface/src/GVRMainWindow.h | 23 +++++++++++++++++++++ gvr-interface/src/main.cpp | 5 +++++ 5 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 gvr-interface/src/GVRMainWindow.cpp create mode 100644 gvr-interface/src/GVRMainWindow.h diff --git a/gvr-interface/CMakeLists.txt b/gvr-interface/CMakeLists.txt index dae4a71392..a34da88768 100644 --- a/gvr-interface/CMakeLists.txt +++ b/gvr-interface/CMakeLists.txt @@ -19,7 +19,6 @@ set(ANDROID_SDK_ROOT $ENV{ANDROID_HOME}) set(ANDROID_APP_DISPLAY_NAME Interface) set(ANDROID_API_LEVEL 19) set(ANDROID_APK_PACKAGE io.highfidelity.gvrinterface) -set(ANDROID_APK_FULLSCREEN true) # we need VRLib, so add a project.properties to our apk build folder that says that find_path(_OCULUS_VRLIB_DIR NAME VRLib.vcxproj HINTS "/ovr_mobile_sdk/VRLib/") diff --git a/gvr-interface/src/GVRInterface.cpp b/gvr-interface/src/GVRInterface.cpp index 31b45bc803..acf9083434 100644 --- a/gvr-interface/src/GVRInterface.cpp +++ b/gvr-interface/src/GVRInterface.cpp @@ -9,7 +9,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#include #include #include "GVRInterface.h" @@ -17,6 +16,5 @@ GVRInterface::GVRInterface(int argc, char* argv[]) : QApplication(argc, argv) { - QMainWindow mainWindow; - mainWindow.menuBar()->addAction("Go to Address"); + } \ No newline at end of file diff --git a/gvr-interface/src/GVRMainWindow.cpp b/gvr-interface/src/GVRMainWindow.cpp new file mode 100644 index 0000000000..b58246e278 --- /dev/null +++ b/gvr-interface/src/GVRMainWindow.cpp @@ -0,0 +1,31 @@ +// +// GVRMainWindow.cpp +// gvr-interface/src +// +// Created by Stephen Birarda on 1/20/14. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include +#include + +#include "GVRMainWindow.h" + +GVRMainWindow::GVRMainWindow() { + QMenu *fileMenu = new QMenu("File"); + QMenu *helpMenu = new QMenu("Help"); + + menuBar()->addMenu(fileMenu); + menuBar()->addMenu(helpMenu); + + QAction *goToAddress = new QAction("Go to Address", fileMenu); + QAction *aboutQt = new QAction("About Qt", helpMenu); + + fileMenu->addAction(goToAddress); + helpMenu->addAction(aboutQt); + + QObject::connect(aboutQt, &QAction::triggered, qApp, &QApplication::aboutQt); +} diff --git a/gvr-interface/src/GVRMainWindow.h b/gvr-interface/src/GVRMainWindow.h new file mode 100644 index 0000000000..6590638d43 --- /dev/null +++ b/gvr-interface/src/GVRMainWindow.h @@ -0,0 +1,23 @@ +// +// GVRMainWindow.h +// gvr-interface/src +// +// Created by Stephen Birarda on 1/20/14. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_GVRMainWindow_h +#define hifi_GVRMainWindow_h + +#include + +class GVRMainWindow : public QMainWindow { + Q_OBJECT +public: + GVRMainWindow(); +}; + +#endif // hifi_GVRMainWindow_h diff --git a/gvr-interface/src/main.cpp b/gvr-interface/src/main.cpp index b16cfb6cfa..5fa5390df0 100644 --- a/gvr-interface/src/main.cpp +++ b/gvr-interface/src/main.cpp @@ -9,9 +9,14 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include "GVRMainWindow.h" #include "GVRInterface.h" int main(int argc, char* argv[]) { GVRInterface app(argc, argv); + + GVRMainWindow mainWindow; + mainWindow.showMaximized(); + return app.exec(); } \ No newline at end of file