mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
b083795233
The files are WIP and located in desktop-widgets, as these would only be used by the desktop version. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
27 lines
551 B
C++
27 lines
551 B
C++
#include <QQmlContext>
|
|
#include <QDebug>
|
|
#include <QQuickItem>
|
|
|
|
#include "mapwidget.h"
|
|
|
|
MapWidget *MapWidget::m_instance = NULL;
|
|
|
|
MapWidget::MapWidget(QWidget *parent) : QQuickWidget(parent)
|
|
{
|
|
setSource(QUrl(QStringLiteral("qrc:/mapwidget-qml")));
|
|
setResizeMode(QQuickWidget::SizeRootObjectToView);
|
|
|
|
m_rootItem = qobject_cast<QQuickItem *>(rootObject());
|
|
}
|
|
|
|
MapWidget::~MapWidget()
|
|
{
|
|
m_instance = NULL;
|
|
}
|
|
|
|
MapWidget *MapWidget::instance()
|
|
{
|
|
if (m_instance == NULL)
|
|
m_instance = new MapWidget();
|
|
return m_instance;
|
|
}
|