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