Skip to content
Permalink
Browse files

dxf export: add method to update model

  • Loading branch information
jef-n committed Dec 15, 2014
1 parent c37ffa5 commit ac10e692b54fe1e4c76db33bc6fb700d5d8cd83b
Showing with 8 additions and 17 deletions.
  1. +6 −1 src/app/qgsdxfexportdialog.cpp
  2. +2 −3 src/app/qgsdxfexportdialog.h
  3. +0 −13 src/core/dxf/qgsdxfexport.h
@@ -69,7 +69,7 @@ void FieldSelectorDelegate::setEditorData( QWidget *editor, const QModelIndex &i
if ( !fcb )
return;

int idx = m->mAttributeIdx.value( vl, -1 );
int idx = m->attributeIndex( vl );
if ( vl->pendingFields().exists( idx ) )
fcb->setField( vl->pendingFields()[ idx ].name() );
}
@@ -127,6 +127,11 @@ QgsVectorLayer *QgsVectorLayerAndAttributeModel::vectorLayer( const QModelIndex
return dynamic_cast<QgsVectorLayer *>( QgsLayerTree::toLayer( n )->layer() );
}

int QgsVectorLayerAndAttributeModel::attributeIndex( const QgsVectorLayer *vl ) const
{
return mAttributeIdx.value( vl, -1 );
}

QVariant QgsVectorLayerAndAttributeModel::data( const QModelIndex& idx, int role ) const
{
if ( idx.column() == 0 )
@@ -56,16 +56,15 @@ class QgsVectorLayerAndAttributeModel : public QgsLayerTreeModel
QList< QPair<QgsVectorLayer *, int> > layers() const;

QgsVectorLayer *vectorLayer( const QModelIndex &index ) const;
int attributeIndex( const QgsVectorLayer *vl ) const;

void applyVisibilityPreset( const QString &name );

private:
QHash<QgsVectorLayer *, int> mAttributeIdx;
QHash<const QgsVectorLayer *, int> mAttributeIdx;
QModelIndexList mCheckedIndexes;

void applyVisibility( QSet<QString> &visibleLayers, QgsLayerTreeNode *node );

friend FieldSelectorDelegate;
};


@@ -139,19 +139,6 @@ class CORE_EXPORT QgsDxfExport
void writeSymbolLayerLinetype( const QgsSymbolLayerV2* symbolLayer );
void writeLinetype( const QString& styleName, const QVector<qreal>& pattern, QgsSymbolV2::OutputUnit u );

#if 0
//AC1018
void writeHeaderAC1018( QTextStream& stream );
void writeTablesAC1018( QTextStream& stream );
void writeEntitiesAC1018( QTextStream& stream );
void writeEntitiesSymbolLevelsAC1018( QTextStream& stream, QgsVectorLayer* layer );
void writeSymbolLayerLinetypeAC1018( QTextStream& stream, const QgsSymbolLayerV2* symbolLayer );
void writeLinetypeAC1018( QTextStream& stream, const QString& styleName, const QVector<qreal>& pattern, QgsSymbolV2::OutputUnit u );
void writeVertexAC1018( QTextStream& stream, const QgsPoint& pt );
void writePolylineAC1018( QTextStream& stream, const QgsPolyline& line, const QString& layer, const QString& lineStyleName, QColor color,
double width = -1, bool polygon = false );
#endif

QgsRectangle dxfExtent() const;

void addFeature( const QgsSymbolV2RenderContext& ctx, const QString& layer, const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2* symbol );

0 comments on commit ac10e69

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