mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-08-13 10:04:13 +02:00
Add user-defined custom properties on elements
ElementInfoWidget's fixed ~40 predefined ELMT_* keys had no way for a user to add a genuinely new element-info key, even though DiagramContext already stores/round-trips arbitrary keys generically via toXml()/fromXml(). Adds an "Ajouter une propriété personnalisée" button that appends a CustomElementInfoPartWidget row (both key and value user-editable, unlike the fixed ElementInfoPartWidget rows bound to one predefined key). The typed key is validated live against the existing DiagramContext::isKeyAcceptable() and flagged with a red border when it doesn't match, instead of silently dropping it. Any key already present on the element that isn't one of the predefined/special keys is re-displayed as a custom row on next selection. Implements the scope proposed in discussion #611.
This commit is contained in:
@@ -683,6 +683,8 @@ set(QET_SRC_FILES
|
||||
${QET_DIR}/sources/ui/dynamicelementtextitemeditor.h
|
||||
${QET_DIR}/sources/ui/dynamicelementtextmodel.cpp
|
||||
${QET_DIR}/sources/ui/dynamicelementtextmodel.h
|
||||
${QET_DIR}/sources/ui/customelementinfopartwidget.cpp
|
||||
${QET_DIR}/sources/ui/customelementinfopartwidget.h
|
||||
${QET_DIR}/sources/ui/elementinfopartwidget.cpp
|
||||
${QET_DIR}/sources/ui/elementinfopartwidget.h
|
||||
${QET_DIR}/sources/ui/elementinfowidget.cpp
|
||||
|
||||
Reference in New Issue
Block a user