Use QValidator to validate label input.
This commit is contained in:
parent
0badfebcb1
commit
447ae7fc90
|
@ -388,11 +388,12 @@ qint64 FileSystem::maxLabelLength() const
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Validates the label for this FileSystem
|
/** Validates the label for this FileSystem
|
||||||
* @param label the label that will be checked
|
* @param parent the parent widget passed to the QObject constructor
|
||||||
* @return the valid label */
|
* @return QValidator to validate the file system label line edit input */
|
||||||
QString FileSystem::validateLabel(const QString& label) const
|
QValidator* FileSystem::labelValidator(QObject *parent) const
|
||||||
{
|
{
|
||||||
return label.left(maxLabelLength());
|
Q_UNUSED(parent)
|
||||||
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @return this FileSystem's type as printable name */
|
/** @return this FileSystem's type as printable name */
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
|
class QValidator;
|
||||||
class Device;
|
class Device;
|
||||||
class Report;
|
class Report;
|
||||||
|
|
||||||
|
@ -182,7 +183,7 @@ public:
|
||||||
virtual qint64 minCapacity() const;
|
virtual qint64 minCapacity() const;
|
||||||
virtual qint64 maxCapacity() const;
|
virtual qint64 maxCapacity() const;
|
||||||
virtual qint64 maxLabelLength() const;
|
virtual qint64 maxLabelLength() const;
|
||||||
virtual QString validateLabel(const QString& label) const;
|
virtual QValidator* labelValidator(QObject *parent = nullptr) const;
|
||||||
|
|
||||||
virtual SupportTool supportToolName() const;
|
virtual SupportTool supportToolName() const;
|
||||||
virtual bool supportToolFound() const;
|
virtual bool supportToolFound() const;
|
||||||
|
|
Loading…
Reference in New Issue