mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 12:53:12 +02:00
Removing duplicate declaration
This commit is contained in:
parent
fdf2f8395d
commit
9fbd5d79e4
5 changed files with 4 additions and 32 deletions
|
@ -15,7 +15,7 @@
|
||||||
#include "DependencyManager.h"
|
#include "DependencyManager.h"
|
||||||
#include "AddressManager.h"
|
#include "AddressManager.h"
|
||||||
|
|
||||||
QML_DIALOG_DEF(AddressBarDialog)
|
HIFI_QML_DEF(AddressBarDialog)
|
||||||
|
|
||||||
AddressBarDialog::AddressBarDialog(QQuickItem* parent) : OffscreenQmlDialog(parent) {
|
AddressBarDialog::AddressBarDialog(QQuickItem* parent) : OffscreenQmlDialog(parent) {
|
||||||
auto addressManager = DependencyManager::get<AddressManager>();
|
auto addressManager = DependencyManager::get<AddressManager>();
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
class AddressBarDialog : public OffscreenQmlDialog
|
class AddressBarDialog : public OffscreenQmlDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QML_DIALOG_DECL
|
HIFI_QML_DECL
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AddressBarDialog(QQuickItem* parent = nullptr);
|
AddressBarDialog(QQuickItem* parent = nullptr);
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "Menu.h"
|
#include "Menu.h"
|
||||||
#include <NetworkingConstants.h>
|
#include <NetworkingConstants.h>
|
||||||
|
|
||||||
QML_DIALOG_DEF(LoginDialog)
|
HIFI_QML_DEF(LoginDialog)
|
||||||
|
|
||||||
LoginDialog::LoginDialog(QQuickItem *parent) : OffscreenQmlDialog(parent), _rootUrl(NetworkingConstants::METAVERSE_SERVER_URL.toString()) {
|
LoginDialog::LoginDialog(QQuickItem *parent) : OffscreenQmlDialog(parent), _rootUrl(NetworkingConstants::METAVERSE_SERVER_URL.toString()) {
|
||||||
connect(&AccountManager::getInstance(), &AccountManager::loginComplete,
|
connect(&AccountManager::getInstance(), &AccountManager::loginComplete,
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
class LoginDialog : public OffscreenQmlDialog
|
class LoginDialog : public OffscreenQmlDialog
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
QML_DIALOG_DECL
|
HIFI_QML_DECL
|
||||||
|
|
||||||
Q_PROPERTY(QString statusText READ statusText WRITE setStatusText NOTIFY statusTextChanged)
|
Q_PROPERTY(QString statusText READ statusText WRITE setStatusText NOTIFY statusTextChanged)
|
||||||
Q_PROPERTY(QString rootUrl READ rootUrl)
|
Q_PROPERTY(QString rootUrl READ rootUrl)
|
||||||
|
|
|
@ -16,34 +16,6 @@
|
||||||
|
|
||||||
#include "OffscreenUi.h"
|
#include "OffscreenUi.h"
|
||||||
|
|
||||||
#define QML_DIALOG_DECL \
|
|
||||||
private: \
|
|
||||||
static const QString NAME; \
|
|
||||||
static const QUrl QML; \
|
|
||||||
public: \
|
|
||||||
static void registerType(); \
|
|
||||||
static void show(std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {}); \
|
|
||||||
static void toggle(std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {}); \
|
|
||||||
private:
|
|
||||||
|
|
||||||
#define QML_DIALOG_DEF(x) \
|
|
||||||
const QUrl x::QML = QUrl(#x ".qml"); \
|
|
||||||
const QString x::NAME = #x; \
|
|
||||||
\
|
|
||||||
void x::registerType() { \
|
|
||||||
qmlRegisterType<x>("Hifi", 1, 0, NAME.toLocal8Bit().constData()); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
void x::show(std::function<void(QQmlContext*, QObject*)> f) { \
|
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>(); \
|
|
||||||
offscreenUi->show(QML, NAME, f); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
void x::toggle(std::function<void(QQmlContext*, QObject*)> f) { \
|
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>(); \
|
|
||||||
offscreenUi->toggle(QML, NAME, f); \
|
|
||||||
}
|
|
||||||
|
|
||||||
class OffscreenQmlDialog : public QQuickItem
|
class OffscreenQmlDialog : public QQuickItem
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
Loading…
Reference in a new issue