QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl ) : QDialog() , mLayer( vl ) { setupUi( this ); tableWidget->insertRow( 0 ); connect( selectionListWidget, SIGNAL( currentRowChanged( int ) ), this, SLOT( setStackPage( int ) ) ); connect( removeSelectedButton, SIGNAL( clicked() ), this, SLOT( removeSelectedButtonPushed() ) ); connect( loadFromLayerButton, SIGNAL( clicked() ), this, SLOT( loadFromLayerButtonPushed() ) ); connect( loadFromCSVButton, SIGNAL( clicked() ), this, SLOT( loadFromCSVButtonPushed() ) ); connect( tableWidget, SIGNAL( cellChanged( int, int ) ), this, SLOT( vCellChanged( int, int ) ) ); connect( valueRelationEditExpression, SIGNAL( clicked() ), this, SLOT( editValueRelationExpression() ) ); QMapIterator<QString, QgsEditorWidgetFactory*> i( QgsEditorWidgetRegistry::instance()->factories() ); while ( i.hasNext() ) { i.next(); QListWidgetItem* item = new QListWidgetItem( selectionListWidget ); item->setText( i.value()->name() ); item->setData( Qt::UserRole, i.key() ); selectionListWidget->addItem( item ); } valueRelationLayer->clear(); foreach ( QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() ) { QgsVectorLayer *vl = qobject_cast< QgsVectorLayer * >( l ); if ( vl ) valueRelationLayer->addItem( vl->name(), vl->id() ); }
QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl ) : QDialog() , mLayer( vl ) { setupUi( this ); tableWidget->insertRow( 0 ); connect( selectionListWidget, SIGNAL( currentRowChanged( int ) ), this, SLOT( setStackPage( int ) ) ); connect( removeSelectedButton, SIGNAL( clicked() ), this, SLOT( removeSelectedButtonPushed() ) ); connect( loadFromLayerButton, SIGNAL( clicked() ), this, SLOT( loadFromLayerButtonPushed() ) ); connect( loadFromCSVButton, SIGNAL( clicked() ), this, SLOT( loadFromCSVButtonPushed() ) ); connect( tableWidget, SIGNAL( cellChanged( int, int ) ), this, SLOT( vCellChanged( int, int ) ) ); connect( valueRelationEditExpression, SIGNAL( clicked() ), this, SLOT( editValueRelationExpression() ) ); valueRelationLayer->clear(); foreach ( QgsMapLayer *l, QgsMapLayerRegistry::instance()->mapLayers() ) { QgsVectorLayer *vl = qobject_cast< QgsVectorLayer * >( l ); if ( vl ) valueRelationLayer->addItem( vl->name(), vl->id() ); }