Marble
6 #include "RemoveItemEditWidget.h"
12 #include "geodata/data/GeoDataAnimatedUpdate.h"
13 #include "GeoDataUpdate.h"
14 #include "GeoDataDelete.h"
15 #include "MarblePlacemarkModel.h"
19 RemoveItemEditWidget::RemoveItemEditWidget(
const QModelIndex &index,
QWidget *parent ) :
33 comboBoxLabel->
setText( tr(
"Choose item:" ) );
38 m_button->setIcon(
QIcon(QStringLiteral(
":/marble/document-save.png")));
39 connect(m_button, SIGNAL(clicked()),
this, SLOT(
save()));
45 bool RemoveItemEditWidget::editable()
const
47 return m_button->isEnabled();
50 void RemoveItemEditWidget::setFeatureIds(
const QStringList &ids )
52 QString id = animatedUpdateElement()->update()->getDelete()->first().targetId();
53 QString current = m_comboBox->currentIndex() == -1 ? id : m_comboBox->currentText();
55 m_comboBox->addItems( ids );
56 m_comboBox->setCurrentIndex( m_comboBox->findText( current ) );
59 void RemoveItemEditWidget::setDefaultFeatureId(
const QString &featureId )
61 if( m_comboBox->currentIndex() == -1 ) {
62 m_comboBox->setCurrentIndex( m_comboBox->findText( featureId ) );
66 void RemoveItemEditWidget::setEditable(
bool editable )
68 m_button->setEnabled( editable );
71 void RemoveItemEditWidget::save()
73 animatedUpdateElement()->update()->getDelete()->child(0)->setTargetId( m_comboBox->currentText() );
74 emit editingDone(m_index);
77 GeoDataAnimatedUpdate* RemoveItemEditWidget::animatedUpdateElement()
81 auto animatedUpdate = geodata_cast<GeoDataAnimatedUpdate>(
object);
82 Q_ASSERT(animatedUpdate);
83 return animatedUpdate;
88 #include "moc_RemoveItemEditWidget.cpp"
void setText(const QString &)
@ ObjectPointerRole
The pointer to a specific object.
Binds a QML item to a specific geodetic location in screen coordinates.
void setSpacing(int spacing)
void setPixmap(const QPixmap &)
QAction * save(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 04:07:50 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.