aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/mapwidget.cpp
blob: 2ebc92e0a43541f4b0476b2a5dcceb5f41e00d40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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;
}