8#include "WaitEditWidget.h"
10#include <QDoubleSpinBox>
15#include "GeoDataTourControl.h"
16#include "MarblePlacemarkModel.h"
17#include "geodata/data/GeoDataWait.h"
29 layout->setSpacing(5);
31 auto iconLabel =
new QLabel(
this);
32 iconLabel->setPixmap(
QPixmap(QStringLiteral(
":/marble/player-time.png")));
33 layout->addWidget(iconLabel);
35 auto waitLabel =
new QLabel(
this);
36 waitLabel->setText(tr(
"Wait duration:"));
37 layout->addWidget(waitLabel);
39 layout->addWidget(m_spinBox);
40 m_spinBox->setValue(waitElement()->duration());
41 m_spinBox->setSuffix(tr(
" s",
"seconds"));
43 m_button->setIcon(
QIcon(QStringLiteral(
":/marble/document-save.png")));
45 layout->addWidget(m_button);
48bool WaitEditWidget::editable()
const
50 return m_button->isEnabled();
53void WaitEditWidget::setEditable(
bool editable)
55 m_button->setEnabled(editable);
58void WaitEditWidget::save()
60 waitElement()->setDuration(m_spinBox->value());
61 Q_EMIT editingDone(m_index);
64GeoDataWait *WaitEditWidget::waitElement()
66 auto object = qvariant_cast<GeoDataObject *>(m_index.data(MarblePlacemarkModel::ObjectPointerRole));
68 auto wait = geodata_cast<GeoDataWait>(
object);
75#include "moc_WaitEditWidget.cpp"
Binds a QML item to a specific geodetic location in screen coordinates.
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:14 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.