示例#1
0
void GuiPrintNomencl::paramsToDialog(InsetCommandParams const & /*icp*/)
{
	setWidthCO->setCurrentIndex(
		setWidthCO->findData(toqstr(params_["set_width"])));
	
	lengthToWidgets(valueLE,
			unitLC,
			params_["width"],
			Length::defaultUnit());

	bc().setValid(isValid());
}
示例#2
0
void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
	string const & len, Length::UNIT defaultUnit)
{
	if (len.empty()) {
		// no length (UNIT_NONE)
		combo->setCurrentItem(defaultUnit);
		input->setText("");
	} else if (!isValidLength(len) && !isStrDbl(len)) {
		// use input field only for gluelengths
		combo->setCurrentItem(defaultUnit);
		input->setText(toqstr(len));
	} else {
		lengthToWidgets(input, combo, Length(len), defaultUnit);
	}
}
示例#3
0
void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
	docstring const & len, Length::UNIT defaultUnit)
{
	lengthToWidgets(input, combo, to_utf8(len), defaultUnit);
}