[Qt] Allow setting the style via QML
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <QQuickMapboxGL>
|
||||
|
||||
#include <QQuickItem>
|
||||
#include <QString>
|
||||
#include <QtGlobal>
|
||||
|
||||
QQuickMapboxGL::QQuickMapboxGL(QQuickItem *parent_)
|
||||
@@ -156,6 +157,25 @@ QColor QQuickMapboxGL::color() const
|
||||
return QColor();
|
||||
}
|
||||
|
||||
void QQuickMapboxGL::setStyle(const QString &styleUrl)
|
||||
{
|
||||
if (m_style == styleUrl) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_style = styleUrl;
|
||||
|
||||
m_syncState |= StyleNeedsSync;
|
||||
update();
|
||||
|
||||
emit styleChanged();
|
||||
}
|
||||
|
||||
QString QQuickMapboxGL::style() const
|
||||
{
|
||||
return m_style;
|
||||
}
|
||||
|
||||
int QQuickMapboxGL::swapSyncState()
|
||||
{
|
||||
int oldState = m_syncState;
|
||||
|
||||
Reference in New Issue
Block a user