mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
28 lines
551 B
C++
28 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;
|
||
|
}
|