add a working menu to interface to jump to address

This commit is contained in:
Stephen Birarda 2015-01-20 13:14:12 -08:00
parent 246ee41cf3
commit 5704ed78ff
5 changed files with 60 additions and 4 deletions

View file

@ -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/")

View file

@ -9,7 +9,6 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenuBar>
#include "GVRInterface.h"
@ -17,6 +16,5 @@
GVRInterface::GVRInterface(int argc, char* argv[]) :
QApplication(argc, argv)
{
QMainWindow mainWindow;
mainWindow.menuBar()->addAction("Go to Address");
}

View file

@ -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 <QtWidgets/QApplication>
#include <QtWidgets/QMenuBar>
#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);
}

View file

@ -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 <QtWidgets/QMainWindow>
class GVRMainWindow : public QMainWindow {
Q_OBJECT
public:
GVRMainWindow();
};
#endif // hifi_GVRMainWindow_h

View file

@ -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();
}