mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 05:52:38 +02:00
Merge branch 'android' of git://github.com/birarda/hifi into android
This commit is contained in:
commit
fa36a04a94
3 changed files with 31 additions and 29 deletions
|
@ -11,14 +11,13 @@ if (ANDROID)
|
|||
set(ANDROID_ACTIVITY_NAME io.highfidelity.gvrinterface.InterfaceActivity)
|
||||
set(ANDROID_APK_VERSION_NAME "0.1")
|
||||
set(ANDROID_APK_VERSION_CODE 1)
|
||||
set(ANDROID_APK_FULLSCREEN TRUE)
|
||||
set(ANDROID_DEPLOY_QT_INSTALL "--install")
|
||||
|
||||
set(BUILD_SHARED_LIBS ON)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ANDROID_APK_OUTPUT_DIR}/libs/${ANDROID_ABI}")
|
||||
|
||||
setup_hifi_library(Gui Widgets AndroidExtras)
|
||||
|
||||
add_definitions(-DANDROID)
|
||||
else ()
|
||||
setup_hifi_project(Gui Widgets)
|
||||
endif ()
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
#include "GVRMainWindow.h"
|
||||
|
||||
GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
||||
QMainWindow(parent)
|
||||
QMainWindow(parent),
|
||||
_menuBar(NULL)
|
||||
{
|
||||
|
||||
#ifndef ANDROID
|
||||
|
@ -35,25 +36,7 @@ GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
|||
setFixedSize(NOTE_4_WIDTH / 2, NOTE_4_HEIGHT / 2);
|
||||
#endif
|
||||
|
||||
QMenu* fileMenu = new QMenu("File");
|
||||
QMenu* helpMenu = new QMenu("Help");
|
||||
|
||||
menuBar()->addMenu(fileMenu);
|
||||
menuBar()->addMenu(helpMenu);
|
||||
|
||||
QAction* goToAddress = new QAction("Go to Address", fileMenu);
|
||||
connect(goToAddress, &QAction::triggered, this, &GVRMainWindow::showAddressBar);
|
||||
fileMenu->addAction(goToAddress);
|
||||
|
||||
#ifdef ANDROID
|
||||
QAction* goFullScreen = new QAction("Enter Full Screen", fileMenu);
|
||||
connect(goFullScreen, &QAction::triggered, this, &GVRMainWindow::goFullScreen);
|
||||
fileMenu->addAction(goFullScreen);
|
||||
#endif
|
||||
|
||||
QAction* aboutQt = new QAction("About Qt", helpMenu);
|
||||
connect(aboutQt, &QAction::triggered, qApp, &QApplication::aboutQt);
|
||||
helpMenu->addAction(aboutQt);
|
||||
setupMenuBar();
|
||||
|
||||
QWidget* baseWidget = new QWidget(this);
|
||||
|
||||
|
@ -70,12 +53,28 @@ GVRMainWindow::GVRMainWindow(QWidget* parent) :
|
|||
new InterfaceView(baseWidget);
|
||||
}
|
||||
|
||||
void GVRMainWindow::goFullScreen() {
|
||||
#ifdef ANDROID
|
||||
menuBar()->hide();
|
||||
#else
|
||||
showFullScreen();
|
||||
#endif
|
||||
GVRMainWindow::~GVRMainWindow() {
|
||||
delete _menuBar;
|
||||
}
|
||||
|
||||
void GVRMainWindow::setupMenuBar() {
|
||||
QMenu* fileMenu = new QMenu("File");
|
||||
QMenu* helpMenu = new QMenu("Help");
|
||||
|
||||
_menuBar = new QMenuBar(0);
|
||||
|
||||
_menuBar->addMenu(fileMenu);
|
||||
_menuBar->addMenu(helpMenu);
|
||||
|
||||
QAction* goToAddress = new QAction("Go to Address", fileMenu);
|
||||
connect(goToAddress, &QAction::triggered, this, &GVRMainWindow::showAddressBar);
|
||||
fileMenu->addAction(goToAddress);
|
||||
|
||||
QAction* aboutQt = new QAction("About Qt", helpMenu);
|
||||
connect(aboutQt, &QAction::triggered, qApp, &QApplication::aboutQt);
|
||||
helpMenu->addAction(aboutQt);
|
||||
|
||||
setMenuBar(_menuBar);
|
||||
}
|
||||
|
||||
void GVRMainWindow::showAddressBar() {
|
||||
|
|
|
@ -14,17 +14,21 @@
|
|||
|
||||
#include <QtWidgets/QMainWindow>
|
||||
|
||||
class QMenuBar;
|
||||
class QVBoxLayout;
|
||||
|
||||
class GVRMainWindow : public QMainWindow {
|
||||
Q_OBJECT
|
||||
public:
|
||||
GVRMainWindow(QWidget* parent = 0);
|
||||
~GVRMainWindow();
|
||||
public slots:
|
||||
void showAddressBar();
|
||||
void goFullScreen();
|
||||
private:
|
||||
void setupMenuBar();
|
||||
|
||||
QVBoxLayout* _mainLayout;
|
||||
QMenuBar* _menuBar;
|
||||
};
|
||||
|
||||
#endif // hifi_GVRMainWindow_h
|
||||
|
|
Loading…
Reference in a new issue