- add usignedGlueLengthValidator
* GuiVSpace.cpp:
- re-allow the insertion of glue lengths (regression of the qt4 frontend)
(bug 6097)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30692
a592a061-630c-0410-9148-
cb99ea01b6c8
connect(unitCO, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SLOT(change_adaptor()));
- valueLE->setValidator(unsignedLengthValidator(valueLE));
+ valueLE->setValidator(unsignedGlueLengthValidator(valueLE));
// Manage the ok, apply, restore and cancel/close buttons
bc().setPolicy(ButtonPolicy::OkApplyCancelReadOnlyPolicy);
}
+LengthValidator * unsignedGlueLengthValidator(QLineEdit * ed)
+{
+ LengthValidator * v = new LengthValidator(ed);
+ v->setBottom(GlueLength());
+ return v;
+}
+
+
LengthAutoValidator::LengthAutoValidator(QWidget * parent, QString const autotext)
: LengthValidator(parent),
autotext_(autotext)
/// @returns a new @c LengthValidator that does not accept negative lengths.
LengthValidator * unsignedLengthValidator(QLineEdit *);
+
+/** @returns a new @c LengthValidator that does not accept negative lengths.
+ * but glue lengths.
+ */
+LengthValidator * unsignedGlueLengthValidator(QLineEdit *);
+
+
/** A class to ascertain whether the data passed to the @c validate()
* member function can be interpretted as a GlueLength or is @param autotext.
*/