30 #include "ui_LayerSelectorWidgetForm.h" 34 te::qt::widgets::LayerSelectorWidget::LayerSelectorWidget(
QWidget* parent, Qt::WindowFlags f)
36 m_ui(new
Ui::LayerSelectorWidgetForm)
41 m_ui->m_layerSearchToolButton->setIcon(QIcon::fromTheme(
"zoom"));
45 m_layerSearchDlg->getWidget()->enableMultiSelection(
false);
48 connect(m_ui->m_layerSearchToolButton, SIGNAL(clicked()),
this, SLOT(onLayerSearchToolButtonClicked()));
49 connect(m_ui->m_layerComboBox, SIGNAL(activated(
int)),
this, SLOT(onLayerComboBoxActivated(
int)));
66 m_ui->m_layerComboBox->clear();
75 if(
m_ui->m_layerComboBox->count() != 0)
83 std::list<te::map::AbstractLayerPtr>::iterator it =
m_layerList.begin();
89 std::unique_ptr<te::da::DataSetType> dsType = l->getSchema();
91 if(dsType.get() && dsType->hasRaster())
92 m_ui->m_layerComboBox->addItem(it->get()->getTitle().c_str(), QVariant::fromValue(l));
102 std::list<te::map::AbstractLayerPtr>::iterator it =
m_layerList.begin();
108 std::unique_ptr<te::da::DataSetType> dsType = l->getSchema();
110 if(dsType.get() && dsType->hasGeom())
111 m_ui->m_layerComboBox->addItem(it->get()->getTitle().c_str(), QVariant::fromValue(l));
121 std::list<te::map::AbstractLayerPtr>::iterator it =
m_layerList.begin();
127 m_ui->m_layerComboBox->addItem(it->get()->getTitle().c_str(), QVariant::fromValue(l));
137 std::list<te::map::AbstractLayerPtr> list =
m_layerSearchDlg->getWidget()->getSelecteds();
144 int size =
m_ui->m_layerComboBox->count();
146 for(
int i = 0; i < size; ++i)
148 QVariant varLayer =
m_ui->m_layerComboBox->itemData(i, Qt::UserRole);
153 m_ui->m_layerComboBox->setCurrentIndex(i);
166 QVariant varLayer =
m_ui->m_layerComboBox->itemData(index, Qt::UserRole);
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr