mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-03 20:32:04 +02:00
49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
//
|
|
// VrMenu.h
|
|
//
|
|
// Created by Bradley Austin Davis on 2015/04/21
|
|
// Copyright 2015 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
|
|
//
|
|
|
|
#pragma once
|
|
#ifndef hifi_VrMenu_h
|
|
#define hifi_VrMenu_h
|
|
|
|
#include <QQuickItem>
|
|
#include <QHash>
|
|
#include <QList>
|
|
#include <QSignalMapper>
|
|
#include <QAction>
|
|
#include <QMenu>
|
|
#include "OffscreenUi.h"
|
|
|
|
// FIXME break up the rendering code (VrMenu) and the code for mirroring a Widget based menu in QML
|
|
class VrMenu : public QQuickItem {
|
|
Q_OBJECT
|
|
HIFI_QML_DECL_LAMBDA
|
|
|
|
public:
|
|
static void executeOrQueue(std::function<void(VrMenu*)> f);
|
|
static void executeQueuedLambdas();
|
|
VrMenu(QQuickItem* parent = nullptr);
|
|
void addMenu(QMenu* menu);
|
|
void addAction(QMenu* parent, QAction* action);
|
|
void insertAction(QAction* before, QAction* action);
|
|
void removeAction(QAction* action);
|
|
|
|
void setRootMenu(QObject* rootMenu);
|
|
|
|
protected:
|
|
QObject* _rootMenu{ nullptr };
|
|
|
|
QObject* findMenuObject(const QString& name);
|
|
const QObject* findMenuObject(const QString& name) const;
|
|
|
|
static VrMenu* _instance;
|
|
friend class MenuUserData;
|
|
};
|
|
|
|
#endif // hifi_VrMenu_h
|