diff options
Diffstat (limited to 'examples/qml/tutorials/extending-qml-advanced/advanced7-Foreign-objects-integration/library/ThirdPartyDisplay.cpp')
-rw-r--r-- | examples/qml/tutorials/extending-qml-advanced/advanced7-Foreign-objects-integration/library/ThirdPartyDisplay.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/examples/qml/tutorials/extending-qml-advanced/advanced7-Foreign-objects-integration/library/ThirdPartyDisplay.cpp b/examples/qml/tutorials/extending-qml-advanced/advanced7-Foreign-objects-integration/library/ThirdPartyDisplay.cpp new file mode 100644 index 0000000000..5fc4eb2e8f --- /dev/null +++ b/examples/qml/tutorials/extending-qml-advanced/advanced7-Foreign-objects-integration/library/ThirdPartyDisplay.cpp @@ -0,0 +1,45 @@ +// Copyright (C) 2023 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause + +#include "ThirdPartyDisplay.h" +#include <QDebug> + +const QString &ThirdPartyDisplay::content() const +{ + return m_content; +} + +void ThirdPartyDisplay::setContent(const QString &content) +{ + if (m_content != content) { + m_content = content; + emit contentChanged(); + } + qInfo() << QStringLiteral("[Fancy ThirdPartyDisplay] ") + content; +} + +QColor ThirdPartyDisplay::foregroundColor() const +{ + return m_foregroundColor; +} + +void ThirdPartyDisplay::setForegroundColor(QColor color) +{ + if (m_foregroundColor != color) { + m_foregroundColor = color; + emit colorsChanged(); + } +} + +QColor ThirdPartyDisplay::backgroundColor() const +{ + return m_backgroundColor; +} + +void ThirdPartyDisplay::setBackgroundColor(QColor color) +{ + if (m_backgroundColor != color) { + m_backgroundColor = color; + emit colorsChanged(); + } +} |