Skip to content
Permalink
Browse files

Consistent names for Svg classes. Developed for Faunalia (http://www.…

…faunalia.it) with funding from Regione Toscana - Settore SISTEMA INFORMATIVO TERRITORIALE ED AMBIENTALE
  • Loading branch information
mhugent committed Nov 6, 2012
1 parent 32265de commit 5a9418cce08d68c1d823fe70baef8a3724c02eba
@@ -4484,7 +4484,7 @@ bool QgisApp::loadAnnotationItemsFromProject( const QDomDocument& doc )
QDomNodeList svgItemList = doc.elementsByTagName( "SVGAnnotationItem" );
for ( int i = 0; i < svgItemList.size(); ++i )
{
QgsSVGAnnotationItem* newSvgItem = new QgsSVGAnnotationItem( mMapCanvas );
QgsSvgAnnotationItem* newSvgItem = new QgsSvgAnnotationItem( mMapCanvas );
newSvgItem->readXML( doc, svgItemList.at( i ).toElement() );
}
return true;
@@ -70,10 +70,10 @@ QDialog* QgsMapToolAnnotation::createItemEditor( QgsAnnotationItem *item )
return new QgsHtmlAnnotationDialog( hItem );
}

QgsSVGAnnotationItem* sItem = dynamic_cast<QgsSVGAnnotationItem*>( item );
QgsSvgAnnotationItem* sItem = dynamic_cast<QgsSvgAnnotationItem*>( item );
if ( sItem )
{
return new QgsSVGAnnotationDialog( sItem );
return new QgsSvgAnnotationDialog( sItem );
}

return 0;
@@ -31,7 +31,7 @@ QgsMapToolSvgAnnotation::~QgsMapToolSvgAnnotation()

QgsAnnotationItem* QgsMapToolSvgAnnotation::createItem( QMouseEvent* e )
{
QgsSVGAnnotationItem* svgItem = new QgsSVGAnnotationItem( mCanvas );
QgsSvgAnnotationItem* svgItem = new QgsSvgAnnotationItem( mCanvas );
svgItem->setMapPosition( toMapCoordinates( e->pos() ) );
svgItem->setSelected( true );
svgItem->setFrameSize( QSizeF( 200, 100 ) );
@@ -22,7 +22,7 @@
#include <QFileInfo>
#include <QGraphicsScene>

QgsSVGAnnotationDialog::QgsSVGAnnotationDialog( QgsSVGAnnotationItem* item, QWidget * parent, Qt::WindowFlags f):
QgsSvgAnnotationDialog::QgsSvgAnnotationDialog( QgsSvgAnnotationItem* item, QWidget * parent, Qt::WindowFlags f):
QDialog( parent, f ), mItem( item ), mEmbeddedWidget( 0 )
{
setupUi( this );
@@ -42,17 +42,17 @@ QgsSVGAnnotationDialog::QgsSVGAnnotationDialog( QgsSVGAnnotationItem* item, QWid
mButtonBox->addButton( deleteButton, QDialogButtonBox::RejectRole );
}

QgsSVGAnnotationDialog::QgsSVGAnnotationDialog(): QDialog(), mItem( 0 ), mEmbeddedWidget( 0 )
QgsSvgAnnotationDialog::QgsSvgAnnotationDialog(): QDialog(), mItem( 0 ), mEmbeddedWidget( 0 )
{

}

QgsSVGAnnotationDialog::~QgsSVGAnnotationDialog()
QgsSvgAnnotationDialog::~QgsSvgAnnotationDialog()
{

}

void QgsSVGAnnotationDialog::on_mBrowseToolButton_clicked()
void QgsSvgAnnotationDialog::on_mBrowseToolButton_clicked()
{
QString directory;
QFileInfo fi( mFileLineEdit->text() );
@@ -64,7 +64,7 @@ void QgsSVGAnnotationDialog::on_mBrowseToolButton_clicked()
mFileLineEdit->setText( filename );
}

void QgsSVGAnnotationDialog::applySettingsToItem()
void QgsSvgAnnotationDialog::applySettingsToItem()
{
if ( mEmbeddedWidget )
{
@@ -79,7 +79,7 @@ void QgsSVGAnnotationDialog::applySettingsToItem()

}

void QgsSVGAnnotationDialog::deleteItem()
void QgsSvgAnnotationDialog::deleteItem()
{
QGraphicsScene* scene = mItem->scene();
if ( scene )
@@ -20,25 +20,25 @@

#include "ui_qgsformannotationdialogbase.h"

class QgsSVGAnnotationItem;
class QgsSvgAnnotationItem;
class QgsAnnotationWidget;

class QgsSVGAnnotationDialog: public QDialog, private Ui::QgsFormAnnotationDialogBase
class QgsSvgAnnotationDialog: public QDialog, private Ui::QgsFormAnnotationDialogBase
{
Q_OBJECT
public:
QgsSVGAnnotationDialog( QgsSVGAnnotationItem* item, QWidget * parent = 0, Qt::WindowFlags f = 0);
~QgsSVGAnnotationDialog();
QgsSvgAnnotationDialog( QgsSvgAnnotationItem* item, QWidget * parent = 0, Qt::WindowFlags f = 0);
~QgsSvgAnnotationDialog();

private slots:
void on_mBrowseToolButton_clicked();
void applySettingsToItem();
void deleteItem();

private:
QgsSVGAnnotationDialog(); //forbidden
QgsSvgAnnotationDialog(); //forbidden

QgsSVGAnnotationItem* mItem;
QgsSvgAnnotationItem* mItem;
QgsAnnotationWidget* mEmbeddedWidget;
};

@@ -21,17 +21,17 @@
#include <QDomElement>


QgsSVGAnnotationItem::QgsSVGAnnotationItem( QgsMapCanvas* canvas ): QgsAnnotationItem( canvas )
QgsSvgAnnotationItem::QgsSvgAnnotationItem( QgsMapCanvas* canvas ): QgsAnnotationItem( canvas )
{

}

QgsSVGAnnotationItem::~QgsSVGAnnotationItem()
QgsSvgAnnotationItem::~QgsSvgAnnotationItem()
{

}

void QgsSVGAnnotationItem::writeXML( QDomDocument& doc ) const
void QgsSvgAnnotationItem::writeXML( QDomDocument& doc ) const
{
QDomElement documentElem = doc.documentElement();
if ( documentElem.isNull() )
@@ -45,7 +45,7 @@ void QgsSVGAnnotationItem::writeXML( QDomDocument& doc ) const
documentElem.appendChild( svgAnnotationElem );
}

void QgsSVGAnnotationItem::readXML( const QDomDocument& doc, const QDomElement& itemElem )
void QgsSvgAnnotationItem::readXML( const QDomDocument& doc, const QDomElement& itemElem )
{
QString filePath = QgsProject::instance()->readPath( itemElem.attribute( "file" ) );
setFilePath( filePath );
@@ -56,7 +56,7 @@ void QgsSVGAnnotationItem::readXML( const QDomDocument& doc, const QDomElement&
}
}

void QgsSVGAnnotationItem::paint( QPainter* painter )
void QgsSvgAnnotationItem::paint( QPainter* painter )
{
if( !painter )
{
@@ -97,7 +97,7 @@ void QgsSVGAnnotationItem::paint( QPainter* painter )
}
}

void QgsSVGAnnotationItem::setFilePath( const QString& file )
void QgsSvgAnnotationItem::setFilePath( const QString& file )
{
mFilePath = file;
mSvgRenderer.load( mFilePath );
@@ -21,12 +21,12 @@
#include "qgsannotationitem.h"
#include <QSvgRenderer>

class QgsSVGAnnotationItem: public QgsAnnotationItem
class QgsSvgAnnotationItem: public QgsAnnotationItem
{
public:

QgsSVGAnnotationItem( QgsMapCanvas* canvas );
~QgsSVGAnnotationItem();
QgsSvgAnnotationItem( QgsMapCanvas* canvas );
~QgsSvgAnnotationItem();

void writeXML( QDomDocument& doc ) const;
void readXML( const QDomDocument& doc, const QDomElement& itemElem );

0 comments on commit 5a9418c

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