Skip to content
Permalink
Browse files

Enable pal label testing to qgis_bench

  • Loading branch information
m-kuhn committed Apr 25, 2013
1 parent 3977cb6 commit 9e57117e798eab50d081154463d4de7bd98b9900
Showing with 16 additions and 4 deletions.
  1. +13 −2 tests/bench/main.cpp
  2. +3 −2 tests/bench/qgsbench.cpp
@@ -347,10 +347,20 @@ int main( int argc, char *argv[] )
// but QgsApplication inherits from QApplication (GUI)
// it is working, but maybe we should make QgsCoreApplication, which
// could also be used by mapserver
// Don't use QgsApplication( int, char **, bool GUIenabled, QString) which is new
// Note (mkuhn,20.4.2013): Labeling does not work with QCoreApplication, because
// fontconfig needs some X11 dependencies which are initialized in QApplication (GUI)
// using it with QCoreApplication only crashes at the moment.
// Only use QgsApplication( int, char **, bool GUIenabled, QString) for newer versions
// so that this program may be run with old libraries
//QgsApplication myApp( argc, argv, false, configpath );
QCoreApplication myApp( argc, argv );

QCoreApplication *myApp;

#if VERSION_INT >= 10900
myApp = new QgsApplication( argc, argv, false );
#else
myApp = new QCoreApplication( argc, argv );
#endif

if ( myPrefixPath.isEmpty() )
{
@@ -544,5 +554,6 @@ int main( int argc, char *argv[] )
qbench->printLog();

delete qbench;
delete myApp;
QCoreApplication::exit( 0 );
}
@@ -41,6 +41,7 @@
#include "qgslogger.h"
#include "qgsmaplayerregistry.h"
#include "qgsproject.h"
#include "qgspallabeling.h"

#ifdef Q_OS_WIN
// slightly adapted from http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/port/getrusage.c?rev=1.18;content-type=text%2Fplain
@@ -191,8 +192,8 @@ void QgsBench::render()
// TODO: this should be probably set according to project
mMapRenderer->setProjectionsEnabled( true );

// Necessary?
//mMapRenderer->setLabelingEngine( new QgsPalLabeling() );
// Enable labeling
mMapRenderer->setLabelingEngine( new QgsPalLabeling() );

mImage = new QImage( mWidth, mHeight, QImage::Format_ARGB32_Premultiplied );
mImage->fill( 0 );

0 comments on commit 9e57117

Please sign in to comment.
You can’t perform that action at this time.