19#include <QStringListModel>
25MetadataUrlItemDelegate::MetadataUrlItemDelegate( QObject *parent )
26 : QStyledItemDelegate( parent )
31QWidget *MetadataUrlItemDelegate::createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const
33 if ( index.column() == 1 )
36 QComboBox *typeEditor =
new QComboBox( parent );
38 types << QString( ) << QStringLiteral(
"FGDC" ) << QStringLiteral(
"TC211" );
39 QStringListModel *model =
new QStringListModel( parent );
40 model->setStringList( types );
41 typeEditor->setModel( model );
44 else if ( index.column() == 2 )
47 QComboBox *typeFormat =
new QComboBox( parent );
49 formats << QString( ) << QStringLiteral(
"text/plain" ) << QStringLiteral(
"text/xml" );
50 QStringListModel *model =
new QStringListModel( parent );
51 model->setStringList( formats );
52 typeFormat->setModel( model );
56 return QStyledItemDelegate::createEditor( parent, option, index );