33#include <NDEVR/QTDesignObject.h>
34#include <NDEVR/QCustomLineEdit.h>
35#include <NDEVR/RegexFunctions.h>
46 connect(
this, &QCustomLineEdit::editingFinishedSignal,
this, &DesignObjectStringWidget::sendCommand);
55 setDesignProperty(property);
59 if (m_target ==
object)
61 if (!m_target.isNull())
63 disconnect(&m_target.get(), &QTDesignObject::updatedSignal,
this, &DesignObjectStringWidget::onObjectUpdatedSlot);
64 disconnect(&m_target.get(), &QTDesignObject::deletedSignal,
this, &DesignObjectStringWidget::onObjectDeletedSlot);
67 if (!m_target.isNull())
69 connect(&m_target.get(), &QTDesignObject::updatedSignal,
this, &DesignObjectStringWidget::onObjectUpdatedSlot);
70 connect(&m_target.get(), &QTDesignObject::deletedSignal,
this, &DesignObjectStringWidget::onObjectDeletedSlot);
72 setEnabled(!m_target.isNull());
73 onObjectUpdatedSlot();
77 m_property = property;
78 if (m_title.translation().size() == 0)
80 if (property == DesignObject::DesignProperty::e_meta_data)
81 setWindowTitle(m_meta_data.formatTitleString().getAs<QString>());
83 setWindowTitle(String::DisplayString(property).translation().formatTitleString().getAs<QString>());
85 onObjectUpdatedSlot();
88 case DesignObject::DesignProperty::e_file:
89 customValidator().setRegex(RegexFunctions::FileRegex());
99 m_meta_data = metadata;
100 setDesignProperty(DesignObject::DesignProperty::e_meta_data);
104 m_meta_data = metadata;
105 setDesignProperty(DesignObject::DesignProperty::e_meta_data);
110 if (m_title.translation().size() == 0)
112 if (m_property == DesignObject::DesignProperty::e_meta_data)
113 setWindowTitle(m_meta_data.formatTitleString().getAs<QString>());
115 setWindowTitle(String::DisplayString(m_property).translation().formatTitleString().getAs<QString>());
119 setWindowTitle(m_title.translation().getAs<QString>());
128 void onObjectUpdatedSlot();
Definition DesignObject.h:66
DesignProperty
Definition DesignObject.h:94
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:319
Definition QCustomLineEdit.h:118
The core String class for the software.
Definition String.h:47
Any text displayed to the user should be defined as a TranslatedString which allows the.
Definition TranslatedString.h:13