mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-08 00:05:09 -04:00
allow attribute and alias names in actions
git-svn-id: http://svn.osgeo.org/qgis/trunk@14283 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
ff198a85d1
commit
c8c01721e0
@ -37,7 +37,7 @@ class QgsAttributeAction
|
|||||||
#include "qgsattributeaction.h"
|
#include "qgsattributeaction.h"
|
||||||
%End
|
%End
|
||||||
public:
|
public:
|
||||||
QgsAttributeAction();
|
QgsAttributeAction( QgsVectorLayer * );
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~QgsAttributeAction();
|
virtual ~QgsAttributeAction();
|
||||||
@ -53,16 +53,17 @@ class QgsAttributeAction
|
|||||||
// index into values which indicates which value in the values vector
|
// index into values which indicates which value in the values vector
|
||||||
// is to be used if the action has a default placeholder.
|
// is to be used if the action has a default placeholder.
|
||||||
// @note added to python API in 1.6 (without executePython parameter)
|
// @note added to python API in 1.6 (without executePython parameter)
|
||||||
void doAction( int index, const QList< QPair<QString, QString> > &values,
|
void doAction( int index,
|
||||||
|
const QMap<int, QVariant> &values,
|
||||||
int defaultValueIndex = 0 );
|
int defaultValueIndex = 0 );
|
||||||
|
|
||||||
//! Removes all actions
|
//! Removes all actions
|
||||||
void clearActions();
|
void clearActions();
|
||||||
|
|
||||||
//! Expands the given action, replacing all %'s with the value as
|
//! Expands the given action, replacing all %'s with the value as given.
|
||||||
// given.
|
QString expandAction( QString action,
|
||||||
static QString expandAction( QString action, const QList< QPair<QString, QString> > &values,
|
const QMap<int, QVariant> &values,
|
||||||
uint defaultValueIndex );
|
uint defaultValueIndex );
|
||||||
|
|
||||||
//! Writes the actions out in XML format
|
//! Writes the actions out in XML format
|
||||||
bool writeXML( QDomNode& layer_node, QDomDocument& doc ) const;
|
bool writeXML( QDomNode& layer_node, QDomDocument& doc ) const;
|
||||||
|
@ -26,6 +26,7 @@ SET(QGIS_APP_SRCS
|
|||||||
qgsgraduatedsymboldialog.cpp
|
qgsgraduatedsymboldialog.cpp
|
||||||
qgshelpviewer.cpp
|
qgshelpviewer.cpp
|
||||||
qgsidentifyresults.cpp
|
qgsidentifyresults.cpp
|
||||||
|
qgsfeatureaction.cpp
|
||||||
qgslabeldialog.cpp
|
qgslabeldialog.cpp
|
||||||
qgslabelengineconfigdialog.cpp
|
qgslabelengineconfigdialog.cpp
|
||||||
qgslabelinggui.cpp
|
qgslabelinggui.cpp
|
||||||
@ -155,6 +156,7 @@ SET (QGIS_APP_MOC_HDRS
|
|||||||
qgsgraduatedsymboldialog.h
|
qgsgraduatedsymboldialog.h
|
||||||
qgshelpviewer.h
|
qgshelpviewer.h
|
||||||
qgsidentifyresults.h
|
qgsidentifyresults.h
|
||||||
|
qgsfeatureaction.h
|
||||||
qgslabeldialog.h
|
qgslabeldialog.h
|
||||||
qgsmanageconnectionsdialog.h
|
qgsmanageconnectionsdialog.h
|
||||||
qgsmaptoolidentify.h
|
qgsmaptoolidentify.h
|
||||||
|
@ -499,14 +499,11 @@ void QgsAttributeTableModel::incomingChangeLayout()
|
|||||||
|
|
||||||
void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx ) const
|
void QgsAttributeTableModel::executeAction( int action, const QModelIndex &idx ) const
|
||||||
{
|
{
|
||||||
QList< QPair<QString, QString> > attributes;
|
QgsAttributeMap attributes;
|
||||||
|
|
||||||
for ( int i = 0; i < mAttributes.size(); i++ )
|
for ( int i = 0; i < mAttributes.size(); i++ )
|
||||||
{
|
{
|
||||||
attributes << QPair<QString, QString>(
|
attributes.insert( i, data( index( idx.row(), i ), Qt::EditRole ) );
|
||||||
mLayer->pendingFields()[ mAttributes[i] ].name(),
|
|
||||||
data( index( idx.row(), i ), Qt::EditRole ).toString()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mLayer->actions()->doAction( action, attributes, fieldIdx( idx.column() ) );
|
mLayer->actions()->doAction( action, attributes, fieldIdx( idx.column() ) );
|
||||||
|
42
src/app/qgsfeatureaction.cpp
Normal file
42
src/app/qgsfeatureaction.cpp
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
qgsfeatureaction.cpp - description
|
||||||
|
-------------------
|
||||||
|
begin : 2010-09-20
|
||||||
|
copyright : (C) 2010 by Jürgen E. Fischer
|
||||||
|
email : jef at norbit dot de
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
#include "qgsfeatureaction.h"
|
||||||
|
#include "qgsvectorlayer.h"
|
||||||
|
#include "qgsidentifyresults.h"
|
||||||
|
|
||||||
|
QgsFeatureAction::QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem )
|
||||||
|
: QAction( name, results )
|
||||||
|
, mLayer( vl )
|
||||||
|
, mAction( action )
|
||||||
|
{
|
||||||
|
results->retrieveAttributes( featItem, mAttributes, mIdx );
|
||||||
|
}
|
||||||
|
|
||||||
|
QgsFeatureAction::QgsFeatureAction( const QString &name, QgsFeature &f, QgsVectorLayer *layer, int action, QObject *parent )
|
||||||
|
: QAction( name, parent )
|
||||||
|
, mLayer( layer )
|
||||||
|
, mAction( action )
|
||||||
|
{
|
||||||
|
mAttributes = f.attributeMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QgsFeatureAction::execute()
|
||||||
|
{
|
||||||
|
mLayer->actions()->doAction( mAction, mAttributes, mIdx );
|
||||||
|
}
|
49
src/app/qgsfeatureaction.h
Normal file
49
src/app/qgsfeatureaction.h
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
qgsfeatureaction.h - description
|
||||||
|
------------------
|
||||||
|
begin : 2010-09-20
|
||||||
|
copyright : (C) 2010 by Jürgen E. Fischer
|
||||||
|
email : jef at norbit dot de
|
||||||
|
***************************************************************************/
|
||||||
|
|
||||||
|
/***************************************************************************
|
||||||
|
* *
|
||||||
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
***************************************************************************/
|
||||||
|
/* $Id$ */
|
||||||
|
#ifndef QGSFEATUREACTION_H
|
||||||
|
#define QGSFEATUREACTION_H
|
||||||
|
|
||||||
|
#include "qgsfeature.h"
|
||||||
|
|
||||||
|
#include <QList>
|
||||||
|
#include <QPair>
|
||||||
|
#include <QAction>
|
||||||
|
|
||||||
|
class QgsIdentifyResults;
|
||||||
|
class QgsVectorLayer;
|
||||||
|
class QTreeWidgetItem;
|
||||||
|
|
||||||
|
class QgsFeatureAction : public QAction
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
QgsFeatureAction( const QString &name, QgsFeature &f, QgsVectorLayer *vl, int action, QObject *parent );
|
||||||
|
QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem );
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void execute();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QgsVectorLayer *mLayer;
|
||||||
|
int mAction;
|
||||||
|
int mIdx;
|
||||||
|
QgsAttributeMap mAttributes;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -28,6 +28,7 @@
|
|||||||
#include "qgsattributedialog.h"
|
#include "qgsattributedialog.h"
|
||||||
#include "qgsmapcanvas.h"
|
#include "qgsmapcanvas.h"
|
||||||
#include "qgsattributeaction.h"
|
#include "qgsattributeaction.h"
|
||||||
|
#include "qgsfeatureaction.h"
|
||||||
|
|
||||||
#include <QCloseEvent>
|
#include <QCloseEvent>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
@ -44,20 +45,6 @@
|
|||||||
|
|
||||||
#include "qgslogger.h"
|
#include "qgslogger.h"
|
||||||
|
|
||||||
QgsFeatureAction::QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem )
|
|
||||||
: QAction( name, results )
|
|
||||||
, mLayer( vl )
|
|
||||||
, mAction( action )
|
|
||||||
{
|
|
||||||
QList< QPair<QString, QString> > attributes;
|
|
||||||
results->retrieveAttributes( featItem, mAttributes, mIdx );
|
|
||||||
}
|
|
||||||
|
|
||||||
void QgsFeatureAction::execute()
|
|
||||||
{
|
|
||||||
mLayer->actions()->doAction( mAction, mAttributes, mIdx );
|
|
||||||
}
|
|
||||||
|
|
||||||
class QgsIdentifyResultsDock : public QDockWidget
|
class QgsIdentifyResultsDock : public QDockWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -82,9 +69,9 @@ class QgsIdentifyResultsDock : public QDockWidget
|
|||||||
// actions (if any) [userrole: "actions"]
|
// actions (if any) [userrole: "actions"]
|
||||||
// edit [userrole: "edit"]
|
// edit [userrole: "edit"]
|
||||||
// action [userrole: "action", idx]
|
// action [userrole: "action", idx]
|
||||||
// name value
|
// displayname [userroles: fieldIdx, original name] displayvalue [userrole: original value]
|
||||||
// name value
|
// displayname [userroles: fieldIdx, original name] displayvalue [userrole: original value]
|
||||||
// name value
|
// displayname [userroles: fieldIdx, original name] displayvalue [userrole: original value]
|
||||||
// feature
|
// feature
|
||||||
// derived attributes (if any)
|
// derived attributes (if any)
|
||||||
// name value
|
// name value
|
||||||
@ -145,61 +132,74 @@ QTreeWidgetItem *QgsIdentifyResults::layerItem( QObject *layer )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsIdentifyResults::addFeature( QgsMapLayer *layer, int fid,
|
void QgsIdentifyResults::addFeature( QgsVectorLayer *vlayer, int fid,
|
||||||
QString displayField, QString displayValue,
|
const QgsAttributeMap &attributes,
|
||||||
const QMap<QString, QString> &attributes,
|
|
||||||
const QMap<QString, QString> &derivedAttributes )
|
const QMap<QString, QString> &derivedAttributes )
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *layItem = layerItem( layer );
|
QTreeWidgetItem *layItem = layerItem( vlayer );
|
||||||
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
|
|
||||||
QgsRasterLayer *rlayer = qobject_cast<QgsRasterLayer *>( layer );
|
|
||||||
|
|
||||||
if ( layItem == 0 )
|
if ( layItem == 0 )
|
||||||
{
|
{
|
||||||
layItem = new QTreeWidgetItem( QStringList() << QString::number( lstResults->topLevelItemCount() ) << layer->name() );
|
layItem = new QTreeWidgetItem( QStringList() << QString::number( lstResults->topLevelItemCount() ) << vlayer->name() );
|
||||||
layItem->setData( 0, Qt::UserRole, QVariant::fromValue( qobject_cast<QObject *>( layer ) ) );
|
layItem->setData( 0, Qt::UserRole, QVariant::fromValue( qobject_cast<QObject *>( vlayer ) ) );
|
||||||
lstResults->addTopLevelItem( layItem );
|
lstResults->addTopLevelItem( layItem );
|
||||||
|
|
||||||
if ( vlayer )
|
connect( vlayer, SIGNAL( layerDeleted() ), this, SLOT( layerDestroyed() ) );
|
||||||
{
|
connect( vlayer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
|
||||||
connect( vlayer, SIGNAL( layerDeleted() ), this, SLOT( layerDestroyed() ) );
|
connect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
|
||||||
connect( vlayer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
|
connect( vlayer, SIGNAL( attributeValueChanged( int, int, const QVariant & ) ), this, SLOT( attributeValueChanged( int, int, const QVariant & ) ) );
|
||||||
connect( vlayer, SIGNAL( featureDeleted( int ) ), this, SLOT( featureDeleted( int ) ) );
|
connect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
|
||||||
connect( vlayer, SIGNAL( attributeValueChanged( int, int, const QVariant & ) ), this, SLOT( attributeValueChanged( int, int, const QVariant & ) ) );
|
connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
|
||||||
connect( vlayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
|
|
||||||
connect( vlayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
connect( layer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) );
|
|
||||||
connect( layer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QTreeWidgetItem *featItem = new QTreeWidgetItem( QStringList() << displayField << displayValue );
|
QTreeWidgetItem *featItem = new QTreeWidgetItem;
|
||||||
featItem->setData( 0, Qt::UserRole, fid );
|
featItem->setData( 0, Qt::UserRole, fid );
|
||||||
layItem->addChild( featItem );
|
layItem->addChild( featItem );
|
||||||
|
|
||||||
if ( !rlayer || rlayer->providerKey() != "wms" )
|
for ( QgsAttributeMap::const_iterator it = attributes.begin(); it != attributes.end(); it++ )
|
||||||
{
|
{
|
||||||
for ( QMap<QString, QString>::const_iterator it = attributes.begin(); it != attributes.end(); it++ )
|
QTreeWidgetItem *attrItem = new QTreeWidgetItem( QStringList() << QString::number( it.key() ) << it.value().toString() );
|
||||||
{
|
|
||||||
QTreeWidgetItem *attrItem = new QTreeWidgetItem( QStringList() << it.key() << it.value() );
|
|
||||||
if ( vlayer )
|
|
||||||
{
|
|
||||||
attrItem->setData( 0, Qt::UserRole, vlayer->fieldNameIndex( it.key() ) );
|
|
||||||
}
|
|
||||||
featItem->addChild( attrItem );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QTreeWidgetItem *attrItem = new QTreeWidgetItem( QStringList() << attributes.begin().key() << "" );
|
|
||||||
featItem->addChild( attrItem );
|
|
||||||
|
|
||||||
QTextBrowser *tb = new QTextBrowser( attrItem->treeWidget() );
|
const QgsFieldMap &fields = vlayer->pendingFields();
|
||||||
tb->setHtml( attributes.begin().value() );
|
|
||||||
attrItem->treeWidget()->setItemWidget( attrItem, 1, tb );
|
QgsFieldMap::const_iterator fit = fields.find( it.key() );
|
||||||
|
if ( fit == fields.constEnd() )
|
||||||
|
{
|
||||||
|
delete attrItem;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
attrItem->setData( 0, Qt::DisplayRole, vlayer->attributeDisplayName( it.key() ) );
|
||||||
|
attrItem->setData( 0, Qt::UserRole, fit->name() );
|
||||||
|
attrItem->setData( 0, Qt::UserRole + 1, it.key() );
|
||||||
|
|
||||||
|
QVariant value = it.value();
|
||||||
|
attrItem->setData( 1, Qt::UserRole, value );
|
||||||
|
|
||||||
|
switch ( vlayer->editType( it.key() ) )
|
||||||
|
{
|
||||||
|
case QgsVectorLayer::Hidden:
|
||||||
|
// skip the item
|
||||||
|
delete attrItem;
|
||||||
|
continue;
|
||||||
|
|
||||||
|
case QgsVectorLayer::ValueMap:
|
||||||
|
value = vlayer->valueMap( it.key() ).key( it->toString(), QString( "(%1)" ).arg( it->toString() ) );
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
attrItem->setData( 1, Qt::DisplayRole, value );
|
||||||
|
|
||||||
|
if ( fit->name() == vlayer->displayField() )
|
||||||
|
{
|
||||||
|
featItem->setText( 0, attrItem->text( 0 ) );
|
||||||
|
featItem->setText( 1, attrItem->text( 1 ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
featItem->addChild( attrItem );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( derivedAttributes.size() >= 0 )
|
if ( derivedAttributes.size() >= 0 )
|
||||||
@ -214,35 +214,83 @@ void QgsIdentifyResults::addFeature( QgsMapLayer *layer, int fid,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( vlayer )
|
QTreeWidgetItem *actionItem = new QTreeWidgetItem( QStringList() << tr( "(Actions)" ) );
|
||||||
|
actionItem->setData( 0, Qt::UserRole, "actions" );
|
||||||
|
featItem->addChild( actionItem );
|
||||||
|
|
||||||
|
QTreeWidgetItem *editItem = new QTreeWidgetItem( QStringList() << "" << ( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) ) );
|
||||||
|
editItem->setIcon( 0, QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
|
||||||
|
editItem->setData( 0, Qt::UserRole, "edit" );
|
||||||
|
actionItem->addChild( editItem );
|
||||||
|
|
||||||
|
for ( int i = 0; i < vlayer->actions()->size(); i++ )
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *actionItem = new QTreeWidgetItem( QStringList() << tr( "(Actions)" ) );
|
const QgsAction &action = vlayer->actions()->at( i );
|
||||||
actionItem->setData( 0, Qt::UserRole, "actions" );
|
|
||||||
featItem->addChild( actionItem );
|
|
||||||
|
|
||||||
QTreeWidgetItem *editItem = new QTreeWidgetItem( QStringList() << "" << ( vlayer->isEditable() ? tr( "Edit feature form" ) : tr( "View feature form" ) ) );
|
if ( !action.runable() )
|
||||||
editItem->setIcon( 0, QgisApp::getThemeIcon( vlayer->isEditable() ? "/mIconEditable.png" : "/mIconEditable.png" ) );
|
continue;
|
||||||
editItem->setData( 0, Qt::UserRole, "edit" );
|
|
||||||
actionItem->addChild( editItem );
|
|
||||||
|
|
||||||
for ( int i = 0; i < vlayer->actions()->size(); i++ )
|
QTreeWidgetItem *twi = new QTreeWidgetItem( QStringList() << "" << action.name() );
|
||||||
{
|
twi->setIcon( 0, QgisApp::getThemeIcon( "/mAction.png" ) );
|
||||||
const QgsAction &action = vlayer->actions()->at( i );
|
twi->setData( 0, Qt::UserRole, "action" );
|
||||||
|
twi->setData( 0, Qt::UserRole + 1, QVariant::fromValue( i ) );
|
||||||
if ( !action.runable() )
|
actionItem->addChild( twi );
|
||||||
continue;
|
|
||||||
|
|
||||||
QTreeWidgetItem *twi = new QTreeWidgetItem( QStringList() << "" << action.name() );
|
|
||||||
twi->setIcon( 0, QgisApp::getThemeIcon( "/mAction.png" ) );
|
|
||||||
twi->setData( 0, Qt::UserRole, "action" );
|
|
||||||
twi->setData( 0, Qt::UserRole + 1, QVariant::fromValue( i ) );
|
|
||||||
actionItem->addChild( twi );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
highlightFeature( featItem );
|
highlightFeature( featItem );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QgsIdentifyResults::addFeature( QgsRasterLayer *layer,
|
||||||
|
QString label,
|
||||||
|
const QMap<QString, QString> &attributes,
|
||||||
|
const QMap<QString, QString> &derivedAttributes )
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *layItem = layerItem( layer );
|
||||||
|
|
||||||
|
if ( layItem == 0 )
|
||||||
|
{
|
||||||
|
layItem = new QTreeWidgetItem( QStringList() << QString::number( lstResults->topLevelItemCount() ) << layer->name() );
|
||||||
|
layItem->setData( 0, Qt::UserRole, QVariant::fromValue( qobject_cast<QObject *>( layer ) ) );
|
||||||
|
lstResults->addTopLevelItem( layItem );
|
||||||
|
|
||||||
|
connect( layer, SIGNAL( destroyed() ), this, SLOT( layerDestroyed() ) );
|
||||||
|
connect( layer, SIGNAL( layerCrsChanged() ), this, SLOT( layerDestroyed() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
QTreeWidgetItem *featItem = new QTreeWidgetItem( QStringList() << label << "" );
|
||||||
|
featItem->setData( 0, Qt::UserRole, -1 );
|
||||||
|
layItem->addChild( featItem );
|
||||||
|
|
||||||
|
if ( layer && layer->providerKey() == "wms" )
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *attrItem = new QTreeWidgetItem( QStringList() << attributes.begin().key() << "" );
|
||||||
|
featItem->addChild( attrItem );
|
||||||
|
|
||||||
|
QTextBrowser *tb = new QTextBrowser( attrItem->treeWidget() );
|
||||||
|
tb->setHtml( attributes.begin().value() );
|
||||||
|
attrItem->treeWidget()->setItemWidget( attrItem, 1, tb );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for ( QMap<QString, QString>::const_iterator it = attributes.begin(); it != attributes.end(); it++ )
|
||||||
|
{
|
||||||
|
featItem->addChild( new QTreeWidgetItem( QStringList() << it.key() << it.value() ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( derivedAttributes.size() >= 0 )
|
||||||
|
{
|
||||||
|
QTreeWidgetItem *derivedItem = new QTreeWidgetItem( QStringList() << tr( "(Derived)" ) );
|
||||||
|
derivedItem->setData( 0, Qt::UserRole, "derived" );
|
||||||
|
featItem->addChild( derivedItem );
|
||||||
|
|
||||||
|
for ( QMap< QString, QString>::const_iterator it = derivedAttributes.begin(); it != derivedAttributes.end(); it++ )
|
||||||
|
{
|
||||||
|
derivedItem->addChild( new QTreeWidgetItem( QStringList() << it.key() << it.value() ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void QgsIdentifyResults::editingToggled()
|
void QgsIdentifyResults::editingToggled()
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *layItem = layerItem( sender() );
|
QTreeWidgetItem *layItem = layerItem( sender() );
|
||||||
@ -484,7 +532,7 @@ void QgsIdentifyResults::deactivate()
|
|||||||
void QgsIdentifyResults::doAction( QTreeWidgetItem *item, int action )
|
void QgsIdentifyResults::doAction( QTreeWidgetItem *item, int action )
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
QList< QPair<QString, QString> > attributes;
|
QgsAttributeMap attributes;
|
||||||
QTreeWidgetItem *featItem = retrieveAttributes( item, attributes, idx );
|
QTreeWidgetItem *featItem = retrieveAttributes( item, attributes, idx );
|
||||||
if ( !featItem )
|
if ( !featItem )
|
||||||
return;
|
return;
|
||||||
@ -570,7 +618,7 @@ QgsVectorLayer *QgsIdentifyResults::vectorLayer( QTreeWidgetItem *item )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QTreeWidgetItem *QgsIdentifyResults::retrieveAttributes( QTreeWidgetItem *item, QList< QPair<QString, QString> > &attributes, int &idx )
|
QTreeWidgetItem *QgsIdentifyResults::retrieveAttributes( QTreeWidgetItem *item, QgsAttributeMap &attributes, int &idx )
|
||||||
{
|
{
|
||||||
QTreeWidgetItem *featItem = featureItem( item );
|
QTreeWidgetItem *featItem = featureItem( item );
|
||||||
if ( !featItem )
|
if ( !featItem )
|
||||||
@ -585,8 +633,8 @@ QTreeWidgetItem *QgsIdentifyResults::retrieveAttributes( QTreeWidgetItem *item,
|
|||||||
if ( item->childCount() > 0 )
|
if ( item->childCount() > 0 )
|
||||||
continue;
|
continue;
|
||||||
if ( item == lstResults->currentItem() )
|
if ( item == lstResults->currentItem() )
|
||||||
idx = attributes.size();
|
idx = item->data( 0, Qt::UserRole + 1 ).toInt();
|
||||||
attributes << QPair<QString, QString>( item->data( 0, Qt::DisplayRole ).toString(), item->data( 1, Qt::DisplayRole ).toString() );
|
attributes.insert( item->data( 0, Qt::UserRole + 1 ).toInt(), item->data( 1, Qt::DisplayRole ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return featItem;
|
return featItem;
|
||||||
@ -939,13 +987,23 @@ void QgsIdentifyResults::copyFeatureAttributes()
|
|||||||
QClipboard *clipboard = QApplication::clipboard();
|
QClipboard *clipboard = QApplication::clipboard();
|
||||||
QString text;
|
QString text;
|
||||||
|
|
||||||
|
QgsVectorLayer *vlayer = vectorLayer( lstResults->currentItem() );
|
||||||
|
if ( !vlayer )
|
||||||
|
return;
|
||||||
|
|
||||||
int idx;
|
int idx;
|
||||||
QList< QPair<QString, QString> > attributes;
|
QgsAttributeMap attributes;
|
||||||
retrieveAttributes( lstResults->currentItem(), attributes, idx );
|
retrieveAttributes( lstResults->currentItem(), attributes, idx );
|
||||||
|
|
||||||
for ( QList< QPair<QString, QString> >::iterator it = attributes.begin(); it != attributes.end(); it++ )
|
const QgsFieldMap &fields = vlayer->pendingFields();
|
||||||
|
|
||||||
|
for ( QgsAttributeMap::const_iterator it = attributes.begin(); it != attributes.end(); it++ )
|
||||||
{
|
{
|
||||||
text += QString( "%1: %2\n" ).arg( it->first ).arg( it->second );
|
QgsFieldMap::const_iterator fit = fields.find( it.key() );
|
||||||
|
if ( fit == fields.constEnd() )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
text += QString( "%1: %2\n" ).arg( fit->name() ).arg( it.value().toString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
QgsDebugMsg( QString( "set clipboard: %1" ).arg( text ) );
|
QgsDebugMsg( QString( "set clipboard: %1" ).arg( text ) );
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "ui_qgsidentifyresultsbase.h"
|
#include "ui_qgsidentifyresultsbase.h"
|
||||||
#include "qgsattributeaction.h"
|
#include "qgsattributeaction.h"
|
||||||
#include "qgscontexthelp.h"
|
#include "qgscontexthelp.h"
|
||||||
|
#include "qgsfeature.h"
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
@ -31,8 +32,8 @@ class QTreeWidgetItem;
|
|||||||
class QAction;
|
class QAction;
|
||||||
class QMenu;
|
class QMenu;
|
||||||
|
|
||||||
class QgsMapLayer;
|
|
||||||
class QgsVectorLayer;
|
class QgsVectorLayer;
|
||||||
|
class QgsRasterLayer;
|
||||||
class QgsRubberBand;
|
class QgsRubberBand;
|
||||||
class QgsMapCanvas;
|
class QgsMapCanvas;
|
||||||
class QDockWidget;
|
class QDockWidget;
|
||||||
@ -53,9 +54,13 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
|
|||||||
|
|
||||||
~QgsIdentifyResults();
|
~QgsIdentifyResults();
|
||||||
|
|
||||||
/** Add add feature */
|
/** Add add feature from vector layer */
|
||||||
void addFeature( QgsMapLayer *layer, int fid,
|
void addFeature( QgsVectorLayer *layer, int fid,
|
||||||
QString displayField, QString displayValue,
|
const QgsAttributeMap &attributes,
|
||||||
|
const QMap< QString, QString > &derivedAttributes );
|
||||||
|
|
||||||
|
/** Add add feature from other layer */
|
||||||
|
void addFeature( QgsRasterLayer *layer, QString label,
|
||||||
const QMap< QString, QString > &attributes,
|
const QMap< QString, QString > &attributes,
|
||||||
const QMap< QString, QString > &derivedAttributes );
|
const QMap< QString, QString > &derivedAttributes );
|
||||||
|
|
||||||
@ -104,7 +109,7 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
|
|||||||
/* Item in tree was clicked */
|
/* Item in tree was clicked */
|
||||||
void itemClicked( QTreeWidgetItem *lvi, int column );
|
void itemClicked( QTreeWidgetItem *lvi, int column );
|
||||||
|
|
||||||
QTreeWidgetItem *retrieveAttributes( QTreeWidgetItem *item, QList< QPair<QString, QString> > &attributes, int ¤tIdx );
|
QTreeWidgetItem *retrieveAttributes( QTreeWidgetItem *item, QgsAttributeMap &attributes, int ¤tIdx );
|
||||||
|
|
||||||
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
|
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
|
||||||
|
|
||||||
@ -132,21 +137,4 @@ class QgsIdentifyResults: public QDialog, private Ui::QgsIdentifyResultsBase
|
|||||||
QDockWidget *mDock;
|
QDockWidget *mDock;
|
||||||
};
|
};
|
||||||
|
|
||||||
class QgsFeatureAction : public QAction
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
QgsFeatureAction( const QString &name, QgsIdentifyResults *results, QgsVectorLayer *vl, int action, QTreeWidgetItem *featItem );
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void execute();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QgsVectorLayer *mLayer;
|
|
||||||
int mAction;
|
|
||||||
int mIdx;
|
|
||||||
QList< QPair<QString, QString> > mAttributes;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -209,7 +209,6 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
|
|||||||
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;
|
identifyValue = QGis::DEFAULT_IDENTIFY_RADIUS;
|
||||||
|
|
||||||
int featureCount = 0;
|
int featureCount = 0;
|
||||||
const QgsFieldMap& fields = layer->pendingFields();
|
|
||||||
|
|
||||||
// init distance/area calculator
|
// init distance/area calculator
|
||||||
QgsDistanceArea calc;
|
QgsDistanceArea calc;
|
||||||
@ -254,37 +253,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
|
|||||||
featureCount++;
|
featureCount++;
|
||||||
|
|
||||||
int fid = f_it->id();
|
int fid = f_it->id();
|
||||||
QString displayField, displayValue;
|
QMap<QString, QString> derivedAttributes;
|
||||||
QMap<QString, QString> attributes, derivedAttributes;
|
|
||||||
|
|
||||||
const QgsAttributeMap& attr = f_it->attributeMap();
|
|
||||||
|
|
||||||
for ( QgsAttributeMap::const_iterator it = attr.begin(); it != attr.end(); ++it )
|
|
||||||
{
|
|
||||||
QString attributeName = layer->attributeDisplayName( it.key() );
|
|
||||||
QString attributeValue = it->isNull() ? "NULL" : it->toString();
|
|
||||||
|
|
||||||
switch ( layer->editType( it.key() ) )
|
|
||||||
{
|
|
||||||
case QgsVectorLayer::Hidden:
|
|
||||||
continue;
|
|
||||||
|
|
||||||
case QgsVectorLayer::ValueMap:
|
|
||||||
attributeValue = layer->valueMap( it.key() ).key( it->toString(), QString( "(%1)" ).arg( it->toString() ) );
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( fields[it.key()].name() == layer->displayField() )
|
|
||||||
{
|
|
||||||
displayField = attributeName;
|
|
||||||
displayValue = attributeValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
attributes.insert( attributeName, attributeValue );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Calculate derived attributes and insert:
|
// Calculate derived attributes and insert:
|
||||||
// measure distance or area depending on geometry type
|
// measure distance or area depending on geometry type
|
||||||
@ -331,7 +300,7 @@ bool QgsMapToolIdentify::identifyVectorLayer( QgsVectorLayer *layer, int x, int
|
|||||||
|
|
||||||
derivedAttributes.insert( tr( "feature id" ), fid < 0 ? tr( "new feature" ) : QString::number( fid ) );
|
derivedAttributes.insert( tr( "feature id" ), fid < 0 ? tr( "new feature" ) : QString::number( fid ) );
|
||||||
|
|
||||||
results()->addFeature( layer, fid, displayField, displayValue, attributes, derivedAttributes );
|
results()->addFeature( layer, fid, f_it->attributeMap(), derivedAttributes );
|
||||||
}
|
}
|
||||||
|
|
||||||
QgsDebugMsg( "Feature count on identify: " + QString::number( featureCount ) );
|
QgsDebugMsg( "Feature count on identify: " + QString::number( featureCount ) );
|
||||||
@ -392,7 +361,7 @@ bool QgsMapToolIdentify::identifyRasterLayer( QgsRasterLayer *layer, int x, int
|
|||||||
if ( res )
|
if ( res )
|
||||||
{
|
{
|
||||||
derivedAttributes.insert( tr( "(clicked coordinate)" ), idPoint.toString() );
|
derivedAttributes.insert( tr( "(clicked coordinate)" ), idPoint.toString() );
|
||||||
results()->addFeature( layer, -1, type, "", attributes, derivedAttributes );
|
results()->addFeature( layer, type, attributes, derivedAttributes );
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include "qgsattributeaction.h"
|
#include "qgsattributeaction.h"
|
||||||
#include "qgsrunprocess.h"
|
#include "qgsrunprocess.h"
|
||||||
|
#include "qgsvectorlayer.h"
|
||||||
|
|
||||||
static const char * const ident_ = "$Id$";
|
static const char * const ident_ = "$Id$";
|
||||||
|
|
||||||
@ -38,7 +39,7 @@ void QgsAttributeAction::addAction( QgsAction::ActionType type, QString name, QS
|
|||||||
mActions << QgsAction( type, name, action, capture );
|
mActions << QgsAction( type, name, action, capture );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QgsAttributeAction::doAction( int index, const QList< QPair<QString, QString> > &values,
|
void QgsAttributeAction::doAction( int index, const QgsAttributeMap &attributes,
|
||||||
int defaultValueIndex, void ( *executePython )( const QString & ) )
|
int defaultValueIndex, void ( *executePython )( const QString & ) )
|
||||||
{
|
{
|
||||||
if ( index < 0 || index >= size() )
|
if ( index < 0 || index >= size() )
|
||||||
@ -61,7 +62,7 @@ void QgsAttributeAction::doAction( int index, const QList< QPair<QString, QStrin
|
|||||||
|
|
||||||
// The QgsRunProcess instance created by this static function
|
// The QgsRunProcess instance created by this static function
|
||||||
// deletes itself when no longer needed.
|
// deletes itself when no longer needed.
|
||||||
QString expandedAction = expandAction( action.action(), values, defaultValueIndex );
|
QString expandedAction = expandAction( action.action(), attributes, defaultValueIndex );
|
||||||
if ( action.type() == QgsAction::GenericPython )
|
if ( action.type() == QgsAction::GenericPython )
|
||||||
{
|
{
|
||||||
if ( executePython )
|
if ( executePython )
|
||||||
@ -79,7 +80,7 @@ void QgsAttributeAction::doAction( int index, const QList< QPair<QString, QStrin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QgsAttributeAction::expandAction( QString action, const QList< QPair<QString, QString> > &values,
|
QString QgsAttributeAction::expandAction( QString action, const QgsAttributeMap &attributes,
|
||||||
uint clickedOnValue )
|
uint clickedOnValue )
|
||||||
{
|
{
|
||||||
// This function currently replaces all %% characters in the action
|
// This function currently replaces all %% characters in the action
|
||||||
@ -98,19 +99,29 @@ QString QgsAttributeAction::expandAction( QString action, const QList< QPair<QSt
|
|||||||
// for the actual substitutions.
|
// for the actual substitutions.
|
||||||
|
|
||||||
QString expanded_action;
|
QString expanded_action;
|
||||||
if ( clickedOnValue >= 0 && clickedOnValue < static_cast<unsigned int>( values.size() ) )
|
if ( clickedOnValue >= 0 && attributes.contains( clickedOnValue ) )
|
||||||
expanded_action = action.replace( "%%", values[clickedOnValue].second );
|
expanded_action = action.replace( "%%", attributes[clickedOnValue].toString() );
|
||||||
else
|
else
|
||||||
expanded_action = action;
|
expanded_action = action;
|
||||||
|
|
||||||
for ( int i = 0; i < values.size(); ++i )
|
const QgsFieldMap &fields = mLayer->pendingFields();
|
||||||
{
|
|
||||||
// Check for a replace a quoted version and a non-quoted version.
|
|
||||||
QString to_replace_1 = "[%" + values[i].first + "]";
|
|
||||||
QString to_replace_2 = "%" + values[i].first;
|
|
||||||
|
|
||||||
expanded_action = expanded_action.replace( to_replace_1, values[i].second );
|
for ( QgsAttributeMap::const_iterator it = attributes.begin(); it != attributes.end(); it++ )
|
||||||
expanded_action = expanded_action.replace( to_replace_2, values[i].second );
|
{
|
||||||
|
QgsFieldMap::const_iterator fit = fields.find( it.key() );
|
||||||
|
if ( fit == fields.constEnd() )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Check for a replace a quoted version and a non-quoted version.
|
||||||
|
QString to_replace_1 = "[%" + fit->name() + "]";
|
||||||
|
QString to_replace_2 = "%" + fit->name() + "%";
|
||||||
|
QString to_replace_3 = "%" + mLayer->attributeDisplayName( it.key() ) + "%";
|
||||||
|
QString to_replace_4 = "[%" + mLayer->attributeDisplayName( it.key() ) + "%]";
|
||||||
|
|
||||||
|
expanded_action = expanded_action.replace( to_replace_1, it.value().toString() );
|
||||||
|
expanded_action = expanded_action.replace( to_replace_2, it.value().toString() );
|
||||||
|
expanded_action = expanded_action.replace( to_replace_3, it.value().toString() );
|
||||||
|
expanded_action = expanded_action.replace( to_replace_4, it.value().toString() );
|
||||||
}
|
}
|
||||||
|
|
||||||
return expanded_action;
|
return expanded_action;
|
||||||
|
@ -27,12 +27,13 @@
|
|||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QList>
|
|
||||||
#include <QPair>
|
#include <qgsfeature.h>
|
||||||
|
|
||||||
class QDomNode;
|
class QDomNode;
|
||||||
class QDomDocument;
|
class QDomDocument;
|
||||||
class QgsPythonUtils;
|
class QgsPythonUtils;
|
||||||
|
class QgsVectorLayer;
|
||||||
|
|
||||||
/** \ingroup core
|
/** \ingroup core
|
||||||
* Utility class that encapsulates an action based on vector attributes.
|
* Utility class that encapsulates an action based on vector attributes.
|
||||||
@ -95,7 +96,7 @@ class CORE_EXPORT QgsAttributeAction
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
QgsAttributeAction() {}
|
QgsAttributeAction( QgsVectorLayer *layer ) : mLayer( layer ) {}
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~QgsAttributeAction() {}
|
virtual ~QgsAttributeAction() {}
|
||||||
@ -111,16 +112,19 @@ class CORE_EXPORT QgsAttributeAction
|
|||||||
// index into values which indicates which value in the values vector
|
// index into values which indicates which value in the values vector
|
||||||
// is to be used if the action has a default placeholder.
|
// is to be used if the action has a default placeholder.
|
||||||
// @note parameter executePython deprecated (and missing in python binding)
|
// @note parameter executePython deprecated (and missing in python binding)
|
||||||
void doAction( int index, const QList< QPair<QString, QString> > &values,
|
void doAction( int index,
|
||||||
int defaultValueIndex = 0, void ( *executePython )( const QString & ) = 0 );
|
const QgsAttributeMap &attributes,
|
||||||
|
int defaultValueIndex = 0,
|
||||||
|
void ( *executePython )( const QString & ) = 0 );
|
||||||
|
|
||||||
//! Removes all actions
|
//! Removes all actions
|
||||||
void clearActions() { mActions.clear(); }
|
void clearActions() { mActions.clear(); }
|
||||||
|
|
||||||
//! Expands the given action, replacing all %'s with the value as
|
//! Expands the given action, replacing all %'s with the value as
|
||||||
// given.
|
// given.
|
||||||
static QString expandAction( QString action, const QList< QPair<QString, QString> > &values,
|
QString expandAction( QString action,
|
||||||
uint defaultValueIndex );
|
const QgsAttributeMap &attributes,
|
||||||
|
uint defaultValueIndex );
|
||||||
|
|
||||||
//! Writes the actions out in XML format
|
//! Writes the actions out in XML format
|
||||||
bool writeXML( QDomNode& layer_node, QDomDocument& doc ) const;
|
bool writeXML( QDomNode& layer_node, QDomDocument& doc ) const;
|
||||||
@ -136,6 +140,7 @@ class CORE_EXPORT QgsAttributeAction
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QList<QgsAction> mActions;
|
QList<QgsAction> mActions;
|
||||||
|
QgsVectorLayer *mLayer;
|
||||||
static void ( *smPythonExecute )( const QString & );
|
static void ( *smPythonExecute )( const QString & );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,24 +23,24 @@ email : sherman at mrcc.com
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
QgsFeature::QgsFeature( int id, QString typeName )
|
QgsFeature::QgsFeature( int id, QString typeName )
|
||||||
: mFid( id ),
|
: mFid( id )
|
||||||
mGeometry( 0 ),
|
, mGeometry( 0 )
|
||||||
mOwnsGeometry( 0 ),
|
, mOwnsGeometry( 0 )
|
||||||
mValid( false ),
|
, mValid( false )
|
||||||
mDirty( 0 ),
|
, mDirty( 0 )
|
||||||
mTypeName( typeName )
|
, mTypeName( typeName )
|
||||||
{
|
{
|
||||||
// NOOP
|
// NOOP
|
||||||
}
|
}
|
||||||
|
|
||||||
QgsFeature::QgsFeature( QgsFeature const & rhs )
|
QgsFeature::QgsFeature( QgsFeature const & rhs )
|
||||||
: mFid( rhs.mFid ),
|
: mFid( rhs.mFid )
|
||||||
mAttributes( rhs.mAttributes ),
|
, mAttributes( rhs.mAttributes )
|
||||||
mGeometry( 0 ),
|
, mGeometry( 0 )
|
||||||
mOwnsGeometry( false ),
|
, mOwnsGeometry( false )
|
||||||
mValid( rhs.mValid ),
|
, mValid( rhs.mValid )
|
||||||
mDirty( rhs.mDirty ),
|
, mDirty( rhs.mDirty )
|
||||||
mTypeName( rhs.mTypeName )
|
, mTypeName( rhs.mTypeName )
|
||||||
{
|
{
|
||||||
|
|
||||||
// copy embedded geometry
|
// copy embedded geometry
|
||||||
|
@ -111,7 +111,7 @@ QgsVectorLayer::QgsVectorLayer( QString vectorLayerPath,
|
|||||||
mVertexMarkerOnlyForSelection( false ),
|
mVertexMarkerOnlyForSelection( false ),
|
||||||
mFetching( false )
|
mFetching( false )
|
||||||
{
|
{
|
||||||
mActions = new QgsAttributeAction;
|
mActions = new QgsAttributeAction( this );
|
||||||
|
|
||||||
// if we're given a provider type, try to create and bind one to this layer
|
// if we're given a provider type, try to create and bind one to this layer
|
||||||
if ( ! mProviderKey.isEmpty() )
|
if ( ! mProviderKey.isEmpty() )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user