This commit is contained in:
Christoph Holzheuer
2025-09-09 16:22:59 +02:00
parent 809ef10c0d
commit cbe8b92582
9 changed files with 107 additions and 44 deletions

View File

@@ -64,7 +64,7 @@ XQItem::XQRenderStyleMap XQItem::s_RenderStyleMap
{ "CustomRenderStyle", CustomRenderStyle },
{ "PickerStyle", PickerStyle },
{ "SpinBoxStyle", SpinBoxStyle },
{ "ProgressBarStyle", ProgressBarStyle},
{ "ColorBarStyle", ColorBarStyle},
{ "FormattedStyle", FormattedStyle},
};
@@ -74,7 +74,7 @@ XQItem::XQEditorTypeMap XQItem::s_EditorTypeMap
{ "LineEditType", LineEditType },
{ "ComboBoxType", ComboBoxType },
{ "PickerType", PickerType },
{ "ProgressBarType", ProgressBarType },
{ "ColorBarType", ColorBarType },
{ "SpinBoxType", SpinBoxType},
{ "CustomEditorType", CustomEditorType}
};
@@ -501,7 +501,8 @@ QVariant XQItem::data(int role ) const
case Qt::DisplayRole :
{
QString plainText = contentFallBackText();
if( renderStyle() == XQItem::FormattedStyle)
//if( renderStyle() == XQItem::FormattedStyle)
if( unitType() != XQItem::NoUnitType)
return XQItemType::formatToSI( plainText, unitType() );
return plainText;
}
@@ -614,7 +615,9 @@ void XQItem::setData(const QVariant& value, int role )
case XQItem::ContentRole:
{
QVariant newValue;
if( itemType().renderStyle() == XQItem::FormattedStyle)
//if( itemType().renderStyle() == XQItem::FormattedStyle)
if( unitType() != XQItem::NoUnitType)
newValue = XQItemType::unFormatFromSI( value.toString() );
else
newValue = value;