#include "child_gamma.h" #include namespace DLBO { ChildGamma::ChildGamma() { m_widget = new QWidget(); QVBoxLayout *layout = new QVBoxLayout(m_widget); m_widget->setStyleSheet(QStringLiteral("border: 1px solid purple; background-color: #faf0ff; margin: 5px;")); QLabel *title = new QLabel(QStringLiteral("Kind-Widget 2")); title->setStyleSheet(QStringLiteral("font-weight: bold; color: purple;")); m_staticLabel = new QLabel(QStringLiteral("Warte auf Init-Daten...")); m_liveLabel = new QLabel(QStringLiteral("Warte auf Live-Text...")); layout->addWidget(title); layout->addWidget(m_staticLabel); layout->addWidget(m_liveLabel); } void ChildGamma::setParentData(const QString &data) { if (m_staticLabel) m_staticLabel->setText(QStringLiteral("Init-Wert: %1").arg(data)); } void ChildGamma::updateLiveData(const QString &text) { if (m_liveLabel) { m_liveLabel->setText(text.isEmpty() ? QStringLiteral("Warte auf Live-Text...") : QStringLiteral("Gamma Live: ") + text); } } }