Marble
8 #include "TourControlEditWidget.h"
10 #include <QHBoxLayout>
12 #include <QToolButton>
13 #include <QRadioButton>
15 #include "MarblePlacemarkModel.h"
16 #include "GeoDataTourControl.h"
21 TourControlEditWidget::TourControlEditWidget(
const QModelIndex &index,
QWidget *parent ) :
32 iconLabel->
setPixmap(
QPixmap(QStringLiteral(
":/marble/media-playback-pause.png")));
36 m_radio_play->setText( tr(
"Play" ) );
39 m_radio_pause->setText( tr(
"Pause" ) );
41 if( tourControlElement()->playMode() == GeoDataTourControl::Play ){
42 m_radio_play->setChecked(
true );
44 m_radio_pause->setChecked(
true );
47 m_button->setIcon(
QIcon(QStringLiteral(
":/marble/document-save.png")));
48 connect(m_button, SIGNAL(clicked()),
this, SLOT(
save()));
54 bool TourControlEditWidget::editable()
const
56 return m_button->isEnabled();
59 void TourControlEditWidget::setEditable(
bool editable )
61 m_button->setEnabled( editable );
64 void TourControlEditWidget::save()
66 if ( m_radio_play->isChecked() ) {
67 tourControlElement()->setPlayMode( GeoDataTourControl::Play );
69 tourControlElement()->setPlayMode( GeoDataTourControl::Pause );
71 emit editingDone(m_index);
74 GeoDataTourControl* TourControlEditWidget::tourControlElement()
78 auto tourControl = geodata_cast<GeoDataTourControl>(
object);
79 Q_ASSERT(tourControl);
85 #include "moc_TourControlEditWidget.cpp"
@ ObjectPointerRole
The pointer to a specific object.
Binds a QML item to a specific geodetic location in screen coordinates.
void setSpacing(int spacing)
const QList< QKeySequence > & save()
void setPixmap(const QPixmap &)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:10 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.