diff --git a/demo/viewer/mainwindow.cpp b/demo/viewer/mainwindow.cpp index 753b1286b..ce21cb9c7 100644 --- a/demo/viewer/mainwindow.cpp +++ b/demo/viewer/mainwindow.cpp @@ -107,9 +107,9 @@ MainWindow::MainWindow() connect(slider_, SIGNAL(valueChanged(int)), mapWidget_, SLOT(zoomToLevel(int))); // renderer selector connect(renderer_selector_, - SIGNAL(currentIndexChanged(QString const&)), + SIGNAL(currentIndexChanged(int)), mapWidget_, - SLOT(updateRenderer(QString const&))); + SLOT(updateRenderer(int))); // scale factor connect(scale_factor_, SIGNAL(valueChanged(double)), mapWidget_, SLOT(updateScaleFactor(double))); diff --git a/demo/viewer/mapwidget.cpp b/demo/viewer/mapwidget.cpp index 184b928c4..942c09593 100644 --- a/demo/viewer/mapwidget.cpp +++ b/demo/viewer/mapwidget.cpp @@ -545,15 +545,15 @@ void render_cairo(mapnik::Map const& map, double scaling_factor, QPixmap& pix) #endif } -void MapWidget::updateRenderer(QString const& txt) +void MapWidget::updateRenderer(int index) { - if (txt == "AGG") + std::cerr << "updateRenderer:" << index << std::endl; + if (index == 0) cur_renderer_ = AGG; - else if (txt == "Cairo") + else if (index == 1) cur_renderer_ = Cairo; - else if (txt == "Grid") + else if (index == 2) cur_renderer_ = Grid; - std::cerr << "Update renderer called" << std::endl; updateMap(); } diff --git a/demo/viewer/mapwidget.hpp b/demo/viewer/mapwidget.hpp index 4f6748f71..292ef2e26 100644 --- a/demo/viewer/mapwidget.hpp +++ b/demo/viewer/mapwidget.hpp @@ -82,7 +82,7 @@ class MapWidget : public QWidget void zoomToLevel(int level); void updateMap(); void layerSelected(int); - void updateRenderer(QString const& txt); + void updateRenderer(int); void updateScaleFactor(double scale_factor); signals: void mapViewChanged();