Skip to content
Permalink
Browse files

add column headers and tooltips to dxf export dialog (fixes #13138)

  • Loading branch information
jef-n committed Jul 23, 2015
1 parent 6b25fe5 commit b26d9ac865b7065cd6418478a9b7c5db941cdc95
Showing with 28 additions and 1 deletion.
  1. +26 −0 src/app/qgsdxfexportdialog.cpp
  2. +2 −1 src/app/qgsdxfexportdialog.h
@@ -132,6 +132,26 @@ int QgsVectorLayerAndAttributeModel::attributeIndex( const QgsVectorLayer *vl )
return mAttributeIdx.value( vl, -1 );
}

QVariant QgsVectorLayerAndAttributeModel::headerData( int section, Qt::Orientation orientation, int role ) const
{
if ( orientation == Qt::Horizontal )
{
if ( role == Qt::DisplayRole )
{
if ( section == 0 )
return tr( "Layer" );
else if ( section == 1 )
return tr( "Output layer attribute" );
}
else if ( role == Qt::ToolTipRole )
{
if ( section == 1 )
return tr( "Attribute containing the name of the destination layer in the DXF output." );
}
}
return QVariant();
}

QVariant QgsVectorLayerAndAttributeModel::data( const QModelIndex& idx, int role ) const
{
if ( idx.column() == 0 )
@@ -200,6 +220,11 @@ QVariant QgsVectorLayerAndAttributeModel::data( const QModelIndex& idx, int role
else
return vl->name();
}

if ( role == Qt::ToolTipRole )
{
return tr( "Attribute containing the name of the destination layer in the DXF output." );
}
}

return QVariant();
@@ -389,6 +414,7 @@ QgsDxfExportDialog::QgsDxfExportDialog( QWidget *parent, Qt::WindowFlags f )
model->setFlags( 0 );
mTreeView->setModel( model );
mTreeView->resizeColumnToContents( 0 );
mTreeView->header()->show();

connect( mFileLineEdit, SIGNAL( textChanged( const QString& ) ), this, SLOT( setOkEnabled() ) );
connect( this, SIGNAL( accepted() ), this, SLOT( saveSettings() ) );
@@ -49,6 +49,7 @@ class QgsVectorLayerAndAttributeModel : public QgsLayerTreeModel
~QgsVectorLayerAndAttributeModel();

int columnCount( const QModelIndex &parent = QModelIndex() ) const override;
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const override;
Qt::ItemFlags flags( const QModelIndex &index ) const override;
bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole ) override;
@@ -88,7 +89,7 @@ class QgsDxfExportDialog : public QDialog, private Ui::QgsDxfExportDialogBase
QString encoding() const;

public slots:
/** change the selection of layers in the list */
/** Change the selection of layers in the list */
void selectAll();
void unSelectAll();

0 comments on commit b26d9ac

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