mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
use overloaded constructors to create tests
This commit is contained in:
parent
f717c984b7
commit
e71da9bdfb
@ -35,7 +35,7 @@ class AbstractExtItem : public QDialog
|
|||||||
Q_PROPERTY(QString uniq READ uniq)
|
Q_PROPERTY(QString uniq READ uniq)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AbstractExtItem(QWidget *parent = nullptr,
|
explicit AbstractExtItem(QWidget *parent,
|
||||||
const QString filePath = QString());
|
const QString filePath = QString());
|
||||||
virtual ~AbstractExtItem();
|
virtual ~AbstractExtItem();
|
||||||
virtual void bumpApi(const int _newVer);
|
virtual void bumpApi(const int _newVer);
|
||||||
|
@ -27,7 +27,7 @@ class AWAbstractFormatter : public AbstractExtItem
|
|||||||
Q_PROPERTY(QString type READ type WRITE setType)
|
Q_PROPERTY(QString type READ type WRITE setType)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AWAbstractFormatter(QWidget *parent = nullptr,
|
explicit AWAbstractFormatter(QWidget *parent,
|
||||||
const QString filePath = QString());
|
const QString filePath = QString());
|
||||||
virtual ~AWAbstractFormatter();
|
virtual ~AWAbstractFormatter();
|
||||||
virtual QString convert(const QVariant &_value) const = 0;
|
virtual QString convert(const QVariant &_value) const = 0;
|
||||||
|
@ -35,20 +35,8 @@ AWDateTimeFormatter::AWDateTimeFormatter(QWidget *parent,
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
readConfiguration();
|
if (!filePath.isEmpty())
|
||||||
ui->setupUi(this);
|
readConfiguration();
|
||||||
translate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AWDateTimeFormatter::AWDateTimeFormatter(const QString format, QWidget *parent)
|
|
||||||
: AWAbstractFormatter(parent)
|
|
||||||
, ui(new Ui::AWDateTimeFormatter)
|
|
||||||
{
|
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
|
||||||
|
|
||||||
setFormat(format);
|
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
}
|
}
|
||||||
|
@ -32,8 +32,7 @@ class AWDateTimeFormatter : public AWAbstractFormatter
|
|||||||
Q_PROPERTY(QString format READ format WRITE setFormat)
|
Q_PROPERTY(QString format READ format WRITE setFormat)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AWDateTimeFormatter(QWidget *parent, const QString filePath);
|
explicit AWDateTimeFormatter(QWidget *parent, const QString filePath = QString());
|
||||||
explicit AWDateTimeFormatter(const QString format, QWidget *parent);
|
|
||||||
virtual ~AWDateTimeFormatter();
|
virtual ~AWDateTimeFormatter();
|
||||||
QString convert(const QVariant &_value) const;
|
QString convert(const QVariant &_value) const;
|
||||||
AWDateTimeFormatter *copy(const QString _fileName, const int _number);
|
AWDateTimeFormatter *copy(const QString _fileName, const int _number);
|
||||||
|
@ -33,28 +33,8 @@ AWFloatFormatter::AWFloatFormatter(QWidget *parent, const QString filePath)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
readConfiguration();
|
if (!filePath.isEmpty())
|
||||||
ui->setupUi(this);
|
readConfiguration();
|
||||||
translate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AWFloatFormatter::AWFloatFormatter(const int count, const QChar fillChar,
|
|
||||||
const char format, const double multiplier,
|
|
||||||
const int precision, const double summand,
|
|
||||||
QWidget *parent)
|
|
||||||
: AWAbstractFormatter(parent)
|
|
||||||
, ui(new Ui::AWFloatFormatter)
|
|
||||||
{
|
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
|
||||||
|
|
||||||
setCount(count);
|
|
||||||
setFillChar(fillChar);
|
|
||||||
setFormat(format);
|
|
||||||
setMultiplier(multiplier);
|
|
||||||
setPrecision(precision);
|
|
||||||
setSummand(summand);
|
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
}
|
}
|
||||||
|
@ -37,11 +37,7 @@ class AWFloatFormatter : public AWAbstractFormatter
|
|||||||
Q_PROPERTY(double summand READ summand WRITE setSummand)
|
Q_PROPERTY(double summand READ summand WRITE setSummand)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AWFloatFormatter(QWidget *parent, const QString filePath);
|
explicit AWFloatFormatter(QWidget *parent, const QString filePath = QString());
|
||||||
explicit AWFloatFormatter(const int count, const QChar fillChar,
|
|
||||||
const char format, const double multiplier,
|
|
||||||
const int precision, const double summand,
|
|
||||||
QWidget *parent);
|
|
||||||
virtual ~AWFloatFormatter();
|
virtual ~AWFloatFormatter();
|
||||||
QString convert(const QVariant &_value) const;
|
QString convert(const QVariant &_value) const;
|
||||||
AWFloatFormatter *copy(const QString _fileName, const int _number);
|
AWFloatFormatter *copy(const QString _fileName, const int _number);
|
||||||
|
@ -30,18 +30,8 @@ AWNoFormatter::AWNoFormatter(QWidget *parent, const QString filePath)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
readConfiguration();
|
if (!filePath.isEmpty())
|
||||||
ui->setupUi(this);
|
readConfiguration();
|
||||||
translate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AWNoFormatter::AWNoFormatter(QWidget *parent)
|
|
||||||
: AWAbstractFormatter(parent)
|
|
||||||
, ui(new Ui::AWNoFormatter)
|
|
||||||
{
|
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,7 @@ class AWNoFormatter : public AWAbstractFormatter
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AWNoFormatter(QWidget *parent, const QString filePath);
|
explicit AWNoFormatter(QWidget *parent, const QString filePath = QString());
|
||||||
explicit AWNoFormatter(QWidget *parent);
|
|
||||||
virtual ~AWNoFormatter();
|
virtual ~AWNoFormatter();
|
||||||
QString convert(const QVariant &_value) const;
|
QString convert(const QVariant &_value) const;
|
||||||
AWNoFormatter *copy(const QString _fileName, const int _number);
|
AWNoFormatter *copy(const QString _fileName, const int _number);
|
||||||
|
@ -34,24 +34,8 @@ AWScriptFormatter::AWScriptFormatter(QWidget *parent, const QString filePath)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
readConfiguration();
|
if (!filePath.isEmpty())
|
||||||
ui->setupUi(this);
|
readConfiguration();
|
||||||
translate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AWScriptFormatter::AWScriptFormatter(const bool appendCode, const QString code,
|
|
||||||
const bool hasReturn, QWidget *parent)
|
|
||||||
: AWAbstractFormatter(parent)
|
|
||||||
, ui(new Ui::AWScriptFormatter)
|
|
||||||
{
|
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
|
||||||
|
|
||||||
setAppendCode(appendCode);
|
|
||||||
setCode(code);
|
|
||||||
setHasReturn(hasReturn);
|
|
||||||
initProgram();
|
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
}
|
}
|
||||||
|
@ -35,9 +35,7 @@ class AWScriptFormatter : public AWAbstractFormatter
|
|||||||
Q_PROPERTY(QString program READ program)
|
Q_PROPERTY(QString program READ program)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AWScriptFormatter(QWidget *parent, const QString filePath);
|
explicit AWScriptFormatter(QWidget *parent, const QString filePath = QString());
|
||||||
explicit AWScriptFormatter(const bool appendCode, const QString code,
|
|
||||||
const bool hasReturn, QWidget *parent);
|
|
||||||
virtual ~AWScriptFormatter();
|
virtual ~AWScriptFormatter();
|
||||||
QString convert(const QVariant &_value) const;
|
QString convert(const QVariant &_value) const;
|
||||||
AWScriptFormatter *copy(const QString _fileName, const int _number);
|
AWScriptFormatter *copy(const QString _fileName, const int _number);
|
||||||
|
@ -39,7 +39,8 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString filePath)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
readConfiguration();
|
if (!filePath.isEmpty())
|
||||||
|
readConfiguration();
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class ExtQuotes : public AbstractExtItem
|
|||||||
Q_PROPERTY(QString ticker READ ticker WRITE setTicker)
|
Q_PROPERTY(QString ticker READ ticker WRITE setTicker)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ExtQuotes(QWidget *parent = nullptr,
|
explicit ExtQuotes(QWidget *parent,
|
||||||
const QString filePath = QString());
|
const QString filePath = QString());
|
||||||
virtual ~ExtQuotes();
|
virtual ~ExtQuotes();
|
||||||
ExtQuotes *copy(const QString _fileName, const int _number);
|
ExtQuotes *copy(const QString _fileName, const int _number);
|
||||||
|
@ -36,7 +36,8 @@ ExtScript::ExtScript(QWidget *parent, const QString filePath)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
readConfiguration();
|
if (!filePath.isEmpty())
|
||||||
|
readConfiguration();
|
||||||
readJsonFilters();
|
readJsonFilters();
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
@ -39,7 +39,7 @@ class ExtScript : public AbstractExtItem
|
|||||||
public:
|
public:
|
||||||
enum class Redirect { stdout2stderr, nothing, stderr2stdout, swap };
|
enum class Redirect { stdout2stderr, nothing, stderr2stdout, swap };
|
||||||
|
|
||||||
explicit ExtScript(QWidget *parent = nullptr,
|
explicit ExtScript(QWidget *parent,
|
||||||
const QString filePath = QString());
|
const QString filePath = QString());
|
||||||
virtual ~ExtScript();
|
virtual ~ExtScript();
|
||||||
ExtScript *copy(const QString _fileName, const int _number);
|
ExtScript *copy(const QString _fileName, const int _number);
|
||||||
|
@ -34,7 +34,8 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString filePath)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
readConfiguration();
|
if (!filePath.isEmpty())
|
||||||
|
readConfiguration();
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class ExtUpgrade : public AbstractExtItem
|
|||||||
Q_PROPERTY(int null READ null WRITE setNull)
|
Q_PROPERTY(int null READ null WRITE setNull)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ExtUpgrade(QWidget *parent = nullptr,
|
explicit ExtUpgrade(QWidget *parent,
|
||||||
const QString filePath = QString());
|
const QString filePath = QString());
|
||||||
virtual ~ExtUpgrade();
|
virtual ~ExtUpgrade();
|
||||||
ExtUpgrade *copy(const QString _fileName, const int _number);
|
ExtUpgrade *copy(const QString _fileName, const int _number);
|
||||||
|
@ -40,7 +40,8 @@ ExtWeather::ExtWeather(QWidget *parent, const QString filePath)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
readConfiguration();
|
if (!filePath.isEmpty())
|
||||||
|
readConfiguration();
|
||||||
readJsonMap();
|
readJsonMap();
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
@ -42,7 +42,7 @@ class ExtWeather : public AbstractExtItem
|
|||||||
Q_PROPERTY(int ts READ ts WRITE setTs)
|
Q_PROPERTY(int ts READ ts WRITE setTs)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ExtWeather(QWidget *parent = nullptr,
|
explicit ExtWeather(QWidget *parent,
|
||||||
const QString filePath = QString());
|
const QString filePath = QString());
|
||||||
virtual ~ExtWeather();
|
virtual ~ExtWeather();
|
||||||
ExtWeather *copy(const QString _fileName, const int _number);
|
ExtWeather *copy(const QString _fileName, const int _number);
|
||||||
|
@ -38,7 +38,8 @@ GraphicalItem::GraphicalItem(QWidget *parent, const QString filePath)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
qCDebug(LOG_LIB) << __PRETTY_FUNCTION__;
|
||||||
|
|
||||||
readConfiguration();
|
if (!filePath.isEmpty())
|
||||||
|
readConfiguration();
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
translate();
|
translate();
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public:
|
|||||||
enum class Direction { LeftToRight = 0, RightToLeft = 1 };
|
enum class Direction { LeftToRight = 0, RightToLeft = 1 };
|
||||||
enum class Type { Horizontal, Vertical, Circle, Graph, Bars };
|
enum class Type { Horizontal, Vertical, Circle, Graph, Bars };
|
||||||
|
|
||||||
explicit GraphicalItem(QWidget *parent = nullptr,
|
explicit GraphicalItem(QWidget *parent,
|
||||||
const QString filePath = QString());
|
const QString filePath = QString());
|
||||||
virtual ~GraphicalItem();
|
virtual ~GraphicalItem();
|
||||||
GraphicalItem *copy(const QString _fileName, const int _number);
|
GraphicalItem *copy(const QString _fileName, const int _number);
|
||||||
|
Loading…
Reference in New Issue
Block a user