19#include <QStringListModel>
22#include "moc_qgsmetadataurlitemdelegate.cpp"
26MetadataUrlItemDelegate::MetadataUrlItemDelegate( QObject *parent )
27 : QStyledItemDelegate( parent )
32QWidget *MetadataUrlItemDelegate::createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const
34 if ( index.column() == 1 )
37 QComboBox *typeEditor =
new QComboBox( parent );
39 types << QString( ) << QStringLiteral(
"FGDC" ) << QStringLiteral(
"TC211" );
40 QStringListModel *model =
new QStringListModel( parent );
41 model->setStringList( types );
42 typeEditor->setModel( model );
45 else if ( index.column() == 2 )
48 QComboBox *typeFormat =
new QComboBox( parent );
50 formats << QString( ) << QStringLiteral(
"text/plain" ) << QStringLiteral(
"text/xml" );
51 QStringListModel *model =
new QStringListModel( parent );
52 model->setStringList( formats );
53 typeFormat->setModel( model );
57 return QStyledItemDelegate::createEditor( parent, option, index );