From eaef041c855fe907f7692e9db83d6ec7d10dfd72 Mon Sep 17 00:00:00 2001 From: artemp Date: Thu, 16 May 2013 16:24:18 +0100 Subject: [PATCH] + move to QT 5.x (requirement!) --- demo/viewer/main.cpp | 2 +- demo/viewer/mainwindow.cpp | 5 ++++- demo/viewer/mainwindow.hpp | 2 -- demo/viewer/mapwidget.cpp | 38 +------------------------------------- demo/viewer/viewer.pro | 2 ++ 5 files changed, 8 insertions(+), 41 deletions(-) diff --git a/demo/viewer/main.cpp b/demo/viewer/main.cpp index 73af0c95c..6d83c46a9 100644 --- a/demo/viewer/main.cpp +++ b/demo/viewer/main.cpp @@ -19,7 +19,7 @@ // qt -#include +#include #include #include #include diff --git a/demo/viewer/mainwindow.cpp b/demo/viewer/mainwindow.cpp index 996138678..e87e7a0d4 100644 --- a/demo/viewer/mainwindow.cpp +++ b/demo/viewer/mainwindow.cpp @@ -32,7 +32,10 @@ #include #include #include - +#include +#include +#include +#include // mapnik #ifndef Q_MOC_RUN // QT moc chokes on BOOST_JOIN diff --git a/demo/viewer/mainwindow.hpp b/demo/viewer/mainwindow.hpp index 99936da73..f5f01863f 100644 --- a/demo/viewer/mainwindow.hpp +++ b/demo/viewer/mainwindow.hpp @@ -22,7 +22,6 @@ #define MAINWINDOW_HPP #include -#include #include #include #include @@ -78,7 +77,6 @@ private: LayerTab *layerTab_; StyleTab * styleTab_; MapWidget * mapWidget_; - QPrinter printer; //actions QList exportAsActs; QActionGroup *toolsGroup; diff --git a/demo/viewer/mapwidget.cpp b/demo/viewer/mapwidget.cpp index 0b8753e44..93be08351 100644 --- a/demo/viewer/mapwidget.cpp +++ b/demo/viewer/mapwidget.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -528,42 +527,7 @@ void render_agg(mapnik::Map const& map, double scaling_factor, QPixmap & pix) void render_grid(mapnik::Map const& map, double scaling_factor, QPixmap & pix) { - unsigned width=map.width(); - unsigned height=map.height(); - - mapnik::grid buf(width,height,"F_CODE", 1); - mapnik::grid_renderer ren(map,buf,scaling_factor); - - try - { - ren.apply(); - mapnik::value_integer * imdata = static_cast(buf.raw_data()); - - // Not sure how to display long long values ?? - //QImage image(width,height,QImage::Format_RGB32); - //for (unsigned i = 0 ; i < height ; ++i) - //{ - // for (unsigned j = 0 ; j < width ; ++j) - // { - // image.setPixel(j,i,qRgb((uint8_t)(imdata[i*width+j]>>8), - // (uint8_t)(imdata[i*width+j+1]>>8), - // (uint8_t)(imdata[i*width+j+2]>>8))); - // } - //} - //pix = QPixmap::fromImage(image); - } - catch (mapnik::config_error & ex) - { - std::cerr << ex.what() << std::endl; - } - catch (const std::exception & ex) - { - std::cerr << "exception: " << ex.what() << std::endl; - } - catch (...) - { - std::cerr << "Unknown exception caught!\n"; - } + std::cerr << "Not supported" << std::endl; } diff --git a/demo/viewer/viewer.pro b/demo/viewer/viewer.pro index adf2a46be..a19bc9c95 100644 --- a/demo/viewer/viewer.pro +++ b/demo/viewer/viewer.pro @@ -2,8 +2,10 @@ # Mapnik viewer - Copyright (C) 2007 Artem Pavlenko ###################################################################### TEMPLATE = app +QT += core gui widgets QMAKE_CXX = clang++ QMAKE_CXXFLAGS += $$system(mapnik-config --cxxflags) +QMAKE_CXXFLAGS += $$system(mapnik-config --includes --dep-includes) QMAKE_LFLAGS += $$system(mapnik-config --libs) QMAKE_LFLAGS += $$system(mapnik-config --ldflags --dep-libs) QMAKE_LFLAGS += -lboost_timer