[Qt] Do not use non-Qt headers

This commit is contained in:
Thiago Marcos P. Santos
2016-04-25 14:46:56 +03:00
parent a65c9ca134
commit d00f55de41
3 changed files with 21 additions and 10 deletions

View File

@@ -1,7 +1,5 @@
#include "mapwindow.hpp"
#include <mbgl/util/default_styles.hpp>
#include <QApplication>
#include <QDebug>
#include <QKeyEvent>
@@ -54,16 +52,12 @@ void MapWindow::changeStyle()
{
static uint8_t currentStyleIndex;
mbgl::util::default_styles::DefaultStyle newStyle =
mbgl::util::default_styles::orderedStyles[currentStyleIndex];
auto& styles = QMapbox::defaultStyles();
QString url(newStyle.url);
m_map.setStyleURL(url);
m_map.setStyleURL(styles[currentStyleIndex].first);
setWindowTitle(QString("Mapbox GL: ") + styles[currentStyleIndex].second);
QString name(newStyle.name);
setWindowTitle(QString("Mapbox GL: ") + name);
if (++currentStyleIndex == mbgl::util::default_styles::numOrderedStyles) {
if (++currentStyleIndex == styles.size()) {
currentStyleIndex = 0;
}
}