33#include <NDEVR/QTDesignObject.h>
34#include <NDEVR/QCustomLineEdit.h>
35#include <NDEVR/RegexFunctions.h>
50 connect(
this, &QCustomLineEdit::editingFinishedSignal,
this, &DesignObjectStringWidget::sendCommand);
59 setDesignProperty(property);
63 if (m_target ==
object)
65 if (!m_target.isNull())
67 disconnect(&m_target.get(), &QTDesignObject::updatedSignal,
this, &DesignObjectStringWidget::onObjectUpdatedSlot);
68 disconnect(&m_target.get(), &QTDesignObject::deletedSignal,
this, &DesignObjectStringWidget::onObjectDeletedSlot);
71 if (!m_target.isNull())
73 connect(&m_target.get(), &QTDesignObject::updatedSignal,
this, &DesignObjectStringWidget::onObjectUpdatedSlot);
74 connect(&m_target.get(), &QTDesignObject::deletedSignal,
this, &DesignObjectStringWidget::onObjectDeletedSlot);
76 setEnabled(!m_target.isNull());
77 onObjectUpdatedSlot();
81 m_property = property;
82 if (m_title.isEmpty())
84 if (property == DesignObject::DesignProperty::e_meta_data)
85 setWindowTitle(
String(m_meta_data).formatAsTitleString().getAs<QString>());
87 setWindowTitle(
String(String::DisplayString(property).translation()).formatAsTitleString().getAs<QString>());
89 onObjectUpdatedSlot();
92 case DesignObject::DesignProperty::e_file:
93 customValidator().setRegex(RegexFunctions::FileRegex());
103 m_meta_data = metadata;
104 setDesignProperty(DesignObject::DesignProperty::e_meta_data);
108 m_meta_data = metadata;
109 setDesignProperty(DesignObject::DesignProperty::e_meta_data);
114 if (m_title.isEmpty() == 0)
116 if (m_property == DesignObject::DesignProperty::e_meta_data)
119 QCustomLineEdit::setTitle(String::DisplayString(m_property));
123 QCustomLineEdit::setTitle(title);
A low-level database object that can be used to access general stored properties within the NDEVR Mod...
Definition DesignObject.h:67
DesignProperty
Values stored in the property database.
Definition DesignObject.h:93
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
A line edit allows users to enter and edit a single line of plain text with useful editing functions,...
Definition QCustomLineEdit.h:56
The core String class for the NDEVR API.
Definition String.h:69
Any text displayed to the user should be defined as a TranslatedString which allows the program to lo...
Definition TranslatedString.h:13