29 connect(
this, &QLineEdit::textChanged,
this, &AddressLineEditBase::updatePalette);
32 void updatePalette(
const QString& str)
36 QPalette palette{this->palette()};
37 if(m_validator.validate(s, i) == QValidator::State::Acceptable)
42 auto addr = State::parseAddressAccessor(s);
44 if(Device::try_getNodeFromAddress(m_model->rootNode(), addr->address))
46 palette.setColor(QPalette::Base, QColor{
"#161514"});
47 palette.setColor(QPalette::Light, QColor{
"#c58014"});
48 palette.setColor(QPalette::Midlight, QColor{
"#161514"});
52 palette.setColor(QPalette::Base, QColor{
"#402500"});
53 palette.setColor(QPalette::Light, QColor{
"#660000"});
54 palette.setColor(QPalette::Midlight, QColor{
"#500000"});
59 palette.setColor(QPalette::Base, QColor{
"#161514"});
60 palette.setColor(QPalette::Light, QColor{
"#c58014"});
61 palette.setColor(QPalette::Midlight, QColor{
"#161514"});
66 palette.setColor(QPalette::Base, QColor{
"#300000"});
67 palette.setColor(QPalette::Light, QColor{
"#660000"});
68 palette.setColor(QPalette::Midlight, QColor{
"#500000"});
70 this->setPalette(palette);
74 void dragEnterEvent(QDragEnterEvent* ev)
override
76 static_cast<Parent_T*
>(parent())->dragEnterEvent(ev);
78 void dropEvent(QDropEvent* ev)
override
80 static_cast<Parent_T*
>(parent())->dropEvent(ev);
83 Validator_T m_validator;