Double value has the "unit" option using the internal KPropertyUnit class.
Ints could have the same logic: values could be of Double type, conversions to points could be required.
Example code:
const int cm = 1; // 28.3465058 points const qreal points = KPropertyUnit(KPropertyUnit::Centimeter).fromUserValue(cm); // Note how we have to specify type KProperty::Int explictly otherwise KProperty::Auto will lead to detection of Double type m_set.addProperty(p = new KProperty("cm", points, "Double cm", QString(), KProperty::Int), group); p->setOption("unit", "cm");
See also T1235.