saver string list handling

git-svn-id: http://svn.osgeo.org/qgis/trunk@10236 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
mhugent 2009-02-25 19:15:23 +00:00
parent 246a4d456c
commit 0baa9349ea
13 changed files with 91 additions and 12 deletions

View File

@ -136,7 +136,7 @@ for mk in [ makefile_core, makefile_gui ]:
mk.extra_lib_dirs.append(geos_library_path)
if gdal_library_path!="":
mk.extra_lib_dirs.append(gdal_library_path)
mk.extra_include_dirs = [src_path+"/src/core",
mk.extra_include_dirs = [src_path+"/src/core", src_path+"/src/core/composer",
src_path+"/src/core/raster",
src_path+"/src/core/renderer",
src_path+"/src/core/spatialindex",

View File

@ -11,6 +11,13 @@
%Include qgis.sip
%Include qgsapplication.sip
%Include qgscomposeritem.sip
%Include qgscomposerlabel.sip
%Include qgscomposerlegend.sip
%Include qgscomposermap.sip
%Include qgscomposerpicture.sip
%Include qgscomposerscalebar.sip
%Include qgscomposition.sip
%Include qgscontexthelp.sip
%Include qgscontinuouscolorrenderer.sip
%Include qgscontrastenhancement.sip
@ -25,6 +32,7 @@
%Include qgsgraduatedsymbolrenderer.sip
%Include qgslabel.sip
%Include qgslabelattributes.sip
%Include qgslegendmodel.sip
%Include qgslogger.sip
%Include qgsmaplayer.sip
%Include qgsmaplayerregistry.sip
@ -32,6 +40,7 @@
%Include qgsmaptopixel.sip
%Include qgsmarkercatalogue.sip
%Include qgsmessageoutput.sip
%Include qgspaperitem.sip
%Include qgspoint.sip
%Include qgsproject.sip
%Include qgsprovidermetadata.sip
@ -47,6 +56,7 @@
%Include qgsrect.sip
%Include qgsrendercontext.sip
%Include qgsrenderer.sip
%Include qgsscalebarstyle.sip
%Include qgsscalecalculator.sip
%Include qgssinglesymbolrenderer.sip
%Include qgssnapper.sip

View File

@ -7,8 +7,8 @@
%Import core/core.sip
%Include qgisinterface.sip
%Include qgscomposerview.sip
%Include qgsencodingfiledialog.sip
%Include qgsgenericprojectionselector.sip
%Include qgsmapcanvas.sip

View File

@ -73,6 +73,11 @@ class QgisInterface : QObject
/** Return a pointer to the main window (instance of QgisApp in case of QGIS) */
virtual QWidget * mainWindow()=0;
/** Return pointers to the composer views of the running instance (currently only one)*/
//virtual QList<QgsComposerView*> composerViews()=0;
virtual QList< QPair<QMainWindow*, QgsComposerView*> > composerList() = 0;
/** Add action to the plugins menu */
virtual void addPluginToMenu(QString name, QAction* action)=0;
/** Remove action from the plugins menu */

View File

@ -103,7 +103,13 @@ void QgsComposerScaleBarWidget::on_mMapComboBox_activated( const QString& text )
//extract id
int id;
bool conversionOk;
QString idString = text.split( " " ).at( 1 );
QStringList textSplit = text.split( " " );
if(textSplit.size() < 1)
{
return;
}
QString idString = textSplit.at( textSplit.size() - 1 );
id = idString.toInt( &conversionOk );
if ( !conversionOk )

View File

@ -137,6 +137,9 @@ class QgisApp : public QMainWindow
void saveMapAsImage( QString, QPixmap * );
/** Get the mapcanvas object from the app */
QgsMapCanvas * mapCanvas() { return mMapCanvas; };
QgsComposer* printComposer() {return mComposer;}
//! Set theme (icons)
void setTheme( QString themeName = "default" );
//! Setup the toolbar popup menus for a given theme

View File

@ -24,6 +24,7 @@
#include "qgisappinterface.h"
#include "qgisapp.h"
#include "qgscomposer.h"
#include "qgsmaplayer.h"
#include "qgsmaplayerregistry.h"
#include "qgsmapcanvas.h"
@ -138,6 +139,45 @@ QWidget * QgisAppInterface::mainWindow()
return qgis;
}
#if 0
QList<QgsComposerView*> QgisAppInterface::composerViews()
{
QList<QgsComposerView*> composerViewList;
if(qgis)
{
QgsComposer* c = qgis->printComposer();
if(c)
{
QgsComposerView* v = c->view();
if(v)
{
composerViewList.push_back(v);
}
}
}
return composerViewList;
}
#endif //0
QList< QPair<QMainWindow*, QgsComposerView*> > QgisAppInterface::composerList()
{
QList< QPair<QMainWindow*, QgsComposerView*> > composerList;
if(qgis)
{
QgsComposer* c = qgis->printComposer();
if(c)
{
QgsComposerView* v = c->view();
if(v)
{
composerList.push_back(qMakePair((QMainWindow*)(c), v));
}
}
}
return composerList;
}
void QgisAppInterface::addDockWidget( Qt::DockWidgetArea area, QDockWidget * dockwidget )
{
qgis->addDockWidget( area, dockwidget );

View File

@ -92,6 +92,11 @@ class QgisAppInterface : public QgisInterface
*/
QWidget * mainWindow();
/** Return pointers to the composer views of the running instance (currently only one)*/
//QList<QgsComposerView*> composerViews();
QList< QPair<QMainWindow*, QgsComposerView*> > composerList();
/** Add action to the plugins menu */
void addPluginToMenu( QString name, QAction* action );
/** Remove action from the plugins menu */

View File

@ -55,9 +55,6 @@ class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapB
Rectangle // Display only rectangle
};
/** \brief Initialise GUI and other settings, shared by constructors */
void init( void );
/** \brief Draw to paint device
@param extent map extent
@param size size in scene coordinates
@ -67,9 +64,6 @@ class CORE_EXPORT QgsComposerMap : /*public QWidget, private Ui::QgsComposerMapB
/** \brief Reimplementation of QCanvasItem::paint - draw on canvas */
void paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget );
/** \brief Recalculate rectangle/extent/scale according to current rule */
void recalculate( void );
/** \brief Create cache image */
void cache( void );

View File

@ -23,12 +23,16 @@ class QAction;
class QMenu;
class QToolBar;
class QDockWidget;
class QMainWindow;
class QWidget;
#include <QObject>
#include <QPair>
#include <map>
class QgisApp;
class QgsComposerView;
class QgsMapLayer;
class QgsMapCanvas;
class QgsRasterLayer;
@ -103,6 +107,12 @@ class GUI_EXPORT QgisInterface : public QObject
/** Return a pointer to the main window (instance of QgisApp in case of QGIS) */
virtual QWidget * mainWindow() = 0;
/** Return pointers to composer main windows*/
//virtual QList<QgsComposerView*> composerViews() = 0;
/**Return mainwindows / composer views of running composer instances (currently only one)*/
virtual QList< QPair<QMainWindow*, QgsComposerView*> > composerList() = 0;
/** Add action to the plugins menu */
virtual void addPluginToMenu( QString name, QAction* action ) = 0;
/** Remove action from the plugins menu */

View File

@ -1,4 +1,4 @@
SUBDIRS (copyright_label delimited_text interpolation north_arrow scale_bar)
SUBDIRS (copyright_label delimited_text interpolation north_arrow scale_bar beata)
IF (POSTGRES_FOUND)
SUBDIRS (spit)

View File

@ -76,6 +76,8 @@ int QgsInterpolator::cacheBaseData()
QgsFeature theFeature;
double attributeValue = 0.0;
bool attributeConversionOk = false;
while ( provider->nextFeature( theFeature ) )
{
if ( !zCoordInterpolation )
@ -86,7 +88,11 @@ int QgsInterpolator::cacheBaseData()
{
return 3;
}
attributeValue = att_it.value().toDouble();
attributeValue = att_it.value().toDouble(&attributeConversionOk);
if(!attributeConversionOk) //don't consider vertices with attributes like 'nan' for the interpolation
{
continue;
}
}
if ( addVerticesToCache( theFeature.geometry(), attributeValue ) != 0 )

View File

@ -1,5 +1,5 @@
SUBDIRS (memory ogr wms delimitedtext)
SUBDIRS (memory ogr wms delimitedtext osm_provider)
IF (POSTGRES_FOUND)
SUBDIRS (postgres)