#include "GuiFontLoader.h"
#include "GuiKeySymbol.h"
#include "qt_helpers.h"
+#include "Validator.h"
#include "Author.h"
#include "BufferList.h"
}
-/////////////////////////////////////////////////////////////////////
-//
-// NoNewLineValidator
-//
-/////////////////////////////////////////////////////////////////////
-
-class NoNewLineValidator : public QValidator
-{
-public:
- NoNewLineValidator(QWidget *);
- QValidator::State validate(QString & input, int & pos) const;
-};
-
-
-NoNewLineValidator::NoNewLineValidator(QWidget * parent)
- : QValidator(parent)
-{
-}
-
-
-QValidator::State NoNewLineValidator::validate(QString & input, int & /*pos*/) const
-{
- input.remove(QRegExp("[\\n\\r]"));
- return QValidator::Acceptable;
-}
-
-
/////////////////////////////////////////////////////////////////////
//
// StrftimeValidator
}
+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),
};
+// A class to ascertain that no newline characters are passed.
+class NoNewLineValidator : public QValidator
+{
+ Q_OBJECT
+public:
+ // Define a validator.
+ NoNewLineValidator(QWidget *);
+ // Remove newline characters from input.
+ QValidator::State validate(QString &, int &) const;
+};
+
+
/** A class to ascertain whether the data passed to the @c validate()
* member function is a valid file path.
* The test is active only when the path is to be stored in a LaTeX