]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/Validator.cpp
Also display the info about BibTeX databases in the TeX info panel.
[lyx.git] / src / frontends / qt4 / Validator.cpp
index 59655eb004485b2e3ebc5a833d09425aca538d6e..7f5d5d45e283634838252b710757d72918d08223 100644 (file)
@@ -89,6 +89,14 @@ LengthValidator * unsignedLengthValidator(QLineEdit * ed)
 }
 
 
+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)
@@ -130,6 +138,18 @@ QValidator::State DoubleAutoValidator::validate(QString & input, int & pos) cons
 }
 
 
+NoNewLineValidator::NoNewLineValidator(QWidget * parent)
+       : QValidator(parent)
+{}
+
+
+QValidator::State NoNewLineValidator::validate(QString & qtext, int &) const
+{
+       qtext.remove(QRegExp("[\\n\\r]"));
+       return QValidator::Acceptable;
+}
+
+
 PathValidator::PathValidator(bool acceptable_if_empty,
                             QWidget * parent)
        : QValidator(parent),