[Qt] Use strict signature for add{Source,Layer}
This commit is contained in:
@@ -199,8 +199,8 @@ public:
|
||||
void setMargins(const QMargins &margins);
|
||||
QMargins margins() const;
|
||||
|
||||
void addSource(const QString& sourceID, const QVariant& value);
|
||||
void removeSource(const QString& sourceID);
|
||||
void addSource(const QString &sourceID, const QVariantMap& params);
|
||||
void removeSource(const QString &sourceID);
|
||||
|
||||
void addCustomLayer(const QString &id,
|
||||
QMapbox::CustomLayerInitializeFunction,
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
QMapbox::CustomLayerDeinitializeFunction,
|
||||
void* context,
|
||||
char* before = NULL);
|
||||
void addLayer(const QVariant &value);
|
||||
void addLayer(const QVariantMap ¶ms);
|
||||
void removeLayer(const QString &id);
|
||||
|
||||
void setFilter(const QString &layer, const QVariant &filter);
|
||||
|
||||
@@ -621,12 +621,12 @@ QMargins QMapboxGL::margins() const
|
||||
);
|
||||
}
|
||||
|
||||
void QMapboxGL::addSource(const QString& sourceID, const QVariant& value)
|
||||
void QMapboxGL::addSource(const QString &sourceID, const QVariantMap ¶ms)
|
||||
{
|
||||
using namespace mbgl::style;
|
||||
using namespace mbgl::style::conversion;
|
||||
|
||||
Result<std::unique_ptr<Source>> source = convert<std::unique_ptr<Source>>(value, sourceID.toStdString());
|
||||
Result<std::unique_ptr<Source>> source = convert<std::unique_ptr<Source>>(QVariant(params), sourceID.toStdString());
|
||||
if (!source) {
|
||||
qWarning() << "Unable to add source:" << source.error().message.c_str();
|
||||
return;
|
||||
@@ -658,12 +658,12 @@ void QMapboxGL::addCustomLayer(const QString &id,
|
||||
before ? mbgl::optional<std::string>(before) : mbgl::optional<std::string>());
|
||||
}
|
||||
|
||||
void QMapboxGL::addLayer(const QVariant& value)
|
||||
void QMapboxGL::addLayer(const QVariantMap ¶ms)
|
||||
{
|
||||
using namespace mbgl::style;
|
||||
using namespace mbgl::style::conversion;
|
||||
|
||||
Result<std::unique_ptr<Layer>> layer = convert<std::unique_ptr<Layer>>(value);
|
||||
Result<std::unique_ptr<Layer>> layer = convert<std::unique_ptr<Layer>>(QVariant(params));
|
||||
if (!layer) {
|
||||
qWarning() << "Unable to add layer:" << layer.error().message.c_str();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user