File indexing completed on 2024-12-01 12:41:28
0001 /* 0002 SPDX-FileCopyrightText: 2019 Cyril Rossi <cyril.rossi@enioka.com> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "kpropertywriter_p.h" 0008 0009 QObject *KPropertyWriter::target() const 0010 { 0011 return m_target; 0012 } 0013 0014 QString KPropertyWriter::propertyName() const 0015 { 0016 return m_propertyName; 0017 } 0018 0019 bool KPropertyWriter::writeProperty(const QVariant &value) 0020 { 0021 if (!m_target) { 0022 return false; 0023 } 0024 0025 return m_target->setProperty(qUtf8Printable(m_propertyName), value); 0026 } 0027 0028 void KPropertyWriter::setTarget(QObject *target) 0029 { 0030 if (m_target == target) { 0031 return; 0032 } 0033 0034 m_target = target; 0035 Q_EMIT targetChanged(m_target); 0036 } 0037 0038 void KPropertyWriter::setPropertyName(const QString &propertyName) 0039 { 0040 if (m_propertyName == propertyName) { 0041 return; 0042 } 0043 0044 m_propertyName = propertyName; 0045 Q_EMIT propertyNameChanged(m_propertyName); 0046 } 0047 0048 #include "moc_kpropertywriter_p.cpp"