diff options
author | Ken Moore <ken@ixsystems.com> | 2019-04-03 15:21:17 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2019-04-03 15:21:17 -0400 |
commit | 8d5f1e04d7e4f24a4026804d62abe64883419bf2 (patch) | |
tree | e8de5a663e7c39db7979b61320a220bcbbdfa5ce /src-qt5/desktop-utils/lumina-calculator/EqValidator.h | |
parent | Update README.md (diff) | |
download | lumina-8d5f1e04d7e4f24a4026804d62abe64883419bf2.tar.gz lumina-8d5f1e04d7e4f24a4026804d62abe64883419bf2.tar.bz2 lumina-8d5f1e04d7e4f24a4026804d62abe64883419bf2.zip |
Remove lumina-calculator and lumina-pdf from the lumina repo.
They have their own repos now (https://github.com/lumina-desktop/lumina-[pdf/calculator])
Diffstat (limited to 'src-qt5/desktop-utils/lumina-calculator/EqValidator.h')
-rw-r--r-- | src-qt5/desktop-utils/lumina-calculator/EqValidator.h | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src-qt5/desktop-utils/lumina-calculator/EqValidator.h b/src-qt5/desktop-utils/lumina-calculator/EqValidator.h deleted file mode 100644 index 8bceb240..00000000 --- a/src-qt5/desktop-utils/lumina-calculator/EqValidator.h +++ /dev/null @@ -1,39 +0,0 @@ -//=========================================== -// Lumina Desktop source code -// Copyright (c) 2016, Ken Moore -// Available under the 3-clause BSD license -// See the LICENSE file for full details -//=========================================== -#ifndef _LUMINA_CALCULATOR_VALIDATOR_H -#define _LUMINA_CALCULATOR_VALIDATOR_H - -#define VALIDCHARS QString("x*+-/^%eE().0123456789#acosinthqrlog\u03C0") -#define NOSTARTCHARS QString("x*/^%)eE.") -#define NOENDCHARS QString("x*/^(eE.#") -#define NOCHANGE QString("().#") - -#include <QValidator> -#include <QString> -#include <QDebug> - -class EqValidator : public QValidator{ - Q_OBJECT -public: - EqValidator(QObject *parent = 0) : QValidator(parent){} - ~EqValidator(){} - - virtual void fixup(QString &input) const{ - if(input.isEmpty()){ return; } - if( NOSTARTCHARS.contains(input.left(1)) && !NOCHANGE.contains(input.left(1)) ){ input.prepend("1"); } - if( NOENDCHARS.contains(input.right(1)) && !NOCHANGE.contains(input.right(1)) ){ input.append("1"); } - } - - virtual QValidator::State validate(QString &input, int&pos) const { - //qDebug() << "Got validate:" << input << pos; - if(pos>0 && !VALIDCHARS.contains(input[pos-1])){ return QValidator::Invalid; } - if(!input.isEmpty() && NOSTARTCHARS.contains(input.left(1))){ return QValidator::Intermediate; } - if(!input.isEmpty() && NOENDCHARS.contains(input.right(1))){ return QValidator::Intermediate; } - return QValidator::Acceptable; - } -}; -#endif |