8#include "TourControlEditWidget.h"
12#include <QRadioButton>
15#include "GeoDataTourControl.h"
16#include "MarblePlacemarkModel.h"
29 layout->setSpacing(5);
31 auto iconLabel =
new QLabel(
this);
32 iconLabel->setPixmap(
QPixmap(QStringLiteral(
":/marble/media-playback-pause.png")));
33 layout->addWidget(iconLabel);
35 layout->addWidget(m_radio_play);
36 m_radio_play->setText(tr(
"Play"));
38 layout->addWidget(m_radio_pause);
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")));
49 layout->addWidget(m_button);
52bool TourControlEditWidget::editable()
const
54 return m_button->isEnabled();
57void TourControlEditWidget::setEditable(
bool editable)
59 m_button->setEnabled(editable);
62void TourControlEditWidget::save()
64 if (m_radio_play->isChecked()) {
65 tourControlElement()->setPlayMode(GeoDataTourControl::Play);
67 tourControlElement()->setPlayMode(GeoDataTourControl::Pause);
69 Q_EMIT editingDone(m_index);
72GeoDataTourControl *TourControlEditWidget::tourControlElement()
74 auto object = qvariant_cast<GeoDataObject *>(m_index.data(MarblePlacemarkModel::ObjectPointerRole));
76 auto tourControl = geodata_cast<GeoDataTourControl>(
object);
77 Q_ASSERT(tourControl);
83#include "moc_TourControlEditWidget.cpp"
Binds a QML item to a specific geodetic location in screen coordinates.
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)