Skip to content

Commit ac10e69

Browse files
committedDec 15, 2014
dxf export: add method to update model
1 parent c37ffa5 commit ac10e69

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed
 

‎src/app/qgsdxfexportdialog.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void FieldSelectorDelegate::setEditorData( QWidget *editor, const QModelIndex &i
6969
if ( !fcb )
7070
return;
7171

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

130+
int QgsVectorLayerAndAttributeModel::attributeIndex( const QgsVectorLayer *vl ) const
131+
{
132+
return mAttributeIdx.value( vl, -1 );
133+
}
134+
130135
QVariant QgsVectorLayerAndAttributeModel::data( const QModelIndex& idx, int role ) const
131136
{
132137
if ( idx.column() == 0 )

‎src/app/qgsdxfexportdialog.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,15 @@ class QgsVectorLayerAndAttributeModel : public QgsLayerTreeModel
5656
QList< QPair<QgsVectorLayer *, int> > layers() const;
5757

5858
QgsVectorLayer *vectorLayer( const QModelIndex &index ) const;
59+
int attributeIndex( const QgsVectorLayer *vl ) const;
5960

6061
void applyVisibilityPreset( const QString &name );
6162

6263
private:
63-
QHash<QgsVectorLayer *, int> mAttributeIdx;
64+
QHash<const QgsVectorLayer *, int> mAttributeIdx;
6465
QModelIndexList mCheckedIndexes;
6566

6667
void applyVisibility( QSet<QString> &visibleLayers, QgsLayerTreeNode *node );
67-
68-
friend FieldSelectorDelegate;
6968
};
7069

7170

‎src/core/dxf/qgsdxfexport.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,6 @@ class CORE_EXPORT QgsDxfExport
139139
void writeSymbolLayerLinetype( const QgsSymbolLayerV2* symbolLayer );
140140
void writeLinetype( const QString& styleName, const QVector<qreal>& pattern, QgsSymbolV2::OutputUnit u );
141141

142-
#if 0
143-
//AC1018
144-
void writeHeaderAC1018( QTextStream& stream );
145-
void writeTablesAC1018( QTextStream& stream );
146-
void writeEntitiesAC1018( QTextStream& stream );
147-
void writeEntitiesSymbolLevelsAC1018( QTextStream& stream, QgsVectorLayer* layer );
148-
void writeSymbolLayerLinetypeAC1018( QTextStream& stream, const QgsSymbolLayerV2* symbolLayer );
149-
void writeLinetypeAC1018( QTextStream& stream, const QString& styleName, const QVector<qreal>& pattern, QgsSymbolV2::OutputUnit u );
150-
void writeVertexAC1018( QTextStream& stream, const QgsPoint& pt );
151-
void writePolylineAC1018( QTextStream& stream, const QgsPolyline& line, const QString& layer, const QString& lineStyleName, QColor color,
152-
double width = -1, bool polygon = false );
153-
#endif
154-
155142
QgsRectangle dxfExtent() const;
156143

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

0 commit comments

Comments
 (0)
Please sign in to comment.