/** Make sure one given option exists witin root. * If not present, fill inn the input defaults. */ ColorPropertyPtr ColorProperty::initialize(const QString& uid, QString name, QString help, QColor value, QDomNode root) { ColorPropertyPtr retval(new ColorProperty()); retval->mUid = uid; retval->mName = name.isEmpty() ? uid : name; retval->mHelp = help; retval->mStore = XmlOptionItem(uid, root.toElement()); retval->mValue = string2color(retval->mStore.readValue(color2string(value))); return retval; }
/** Make sure one given option exists witin root. * If not present, fill inn the input defaults. */ Vector3DPropertyPtr Vector3DProperty::initialize(const QString& uid, QString name, QString help, Vector3D value, DoubleRange range, int decimals, QDomNode root) { Vector3DPropertyPtr retval(new Vector3DProperty()); retval->mUid = uid; retval->mName = name.isEmpty() ? uid : name; retval->mHelp = help; retval->mRange = range; retval->mStore = XmlOptionItem(uid, root.toElement()); retval->mValue = Vector3D::fromString(retval->mStore.readValue(qstring_cast(Vector3D(0, 0, 0)))); retval->mDecimals = decimals; return retval; }
XmlOptionItem ConsoleWidgetCollection::option(QString name) { return XmlOptionItem(name, mOptions.getElement()); }
XmlOptionItem ControllableSplitter::getShiftStateOption() { return XmlOptionItem("shift_state", mOptions.getElement()); }
XmlOptionItem ControllableSplitter::getSplitterRatioOption() { return XmlOptionItem("splitter_ratio", mOptions.getElement()); }