mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-24 23:47:20 +00:00
prepare to move to generic bars
This commits series introduces bars which may be calculated from any custom formula. For a start I've renamed $bar*tag to $bar* and add new configuration parameters to graphical items.
This commit is contained in:
parent
5c474e822b
commit
362f1fd87e
@ -91,11 +91,7 @@ QStringList AWKeyCache::getRequiredKeys(const QStringList &keys,
|
|||||||
|
|
||||||
// initial copy
|
// initial copy
|
||||||
QSet<QString> used = QSet<QString>::fromList(keys);
|
QSet<QString> used = QSet<QString>::fromList(keys);
|
||||||
// insert bars
|
used.unite(QSet<QString>::fromList(bars));
|
||||||
for (auto bar : bars) {
|
|
||||||
bar.remove(QRegExp(QString("^bar[0-9]{1,}")));
|
|
||||||
used << bar;
|
|
||||||
}
|
|
||||||
// insert keys from tooltip
|
// insert keys from tooltip
|
||||||
for (auto key : tooltip.keys()) {
|
for (auto key : tooltip.keys()) {
|
||||||
if ((key.endsWith(QString("Tooltip"))) && (tooltip[key].toBool())) {
|
if ((key.endsWith(QString("Tooltip"))) && (tooltip[key].toBool())) {
|
||||||
|
@ -226,12 +226,8 @@ QStringList AWKeyOperations::dictKeys() const
|
|||||||
allKeys.append(QString("la5"));
|
allKeys.append(QString("la5"));
|
||||||
allKeys.append(QString("la1"));
|
allKeys.append(QString("la1"));
|
||||||
// bars
|
// bars
|
||||||
QStringList graphicalItemsKeys;
|
for (int i = graphicalItems->activeItems().count() -1; i >= 0; i--)
|
||||||
for (auto item : graphicalItems->items())
|
allKeys.append(graphicalItems->activeItems().at(i)->tag(QString("bar")));
|
||||||
graphicalItemsKeys.append(item->tag());
|
|
||||||
graphicalItemsKeys.sort();
|
|
||||||
for (int i = graphicalItemsKeys.count() - 1; i >= 0; i--)
|
|
||||||
allKeys.append(graphicalItemsKeys.at(i));
|
|
||||||
|
|
||||||
return allKeys;
|
return allKeys;
|
||||||
}
|
}
|
||||||
@ -243,7 +239,7 @@ GraphicalItem *AWKeyOperations::giByKey(const QString key) const
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << "Looking for item" << key;
|
qCDebug(LOG_AW) << "Looking for item" << key;
|
||||||
|
|
||||||
return graphicalItems->itemByTag(key);
|
return graphicalItems->itemByTag(key, QString("bar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -251,11 +247,10 @@ QString AWKeyOperations::infoByKey(QString key) const
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_AW) << "Requested key" << key;
|
qCDebug(LOG_AW) << "Requested key" << key;
|
||||||
|
|
||||||
key.remove(QRegExp(QString("^bar[0-9]{1,}")));
|
if (key.startsWith(QString("bar")))
|
||||||
if (key.startsWith(QString("custom")))
|
return graphicalItems->itemByTag(key, QString("bar"))->uniq();
|
||||||
return extScripts->itemByTagNumber(
|
else if (key.startsWith(QString("custom")))
|
||||||
key.remove(QString("custom")).toInt())
|
return extScripts->itemByTag(key, QString("custom"))->uniq();
|
||||||
->uniq();
|
|
||||||
else if (key.contains(QRegExp(QString("^hdd[rw]"))))
|
else if (key.contains(QRegExp(QString("^hdd[rw]"))))
|
||||||
return QString("%1").arg(m_devices[QString(
|
return QString("%1").arg(m_devices[QString(
|
||||||
"disk")][key.remove(QRegExp(QString("hdd[rw]"))).toInt()]);
|
"disk")][key.remove(QRegExp(QString("hdd[rw]"))).toInt()]);
|
||||||
@ -273,24 +268,12 @@ QString AWKeyOperations::infoByKey(QString key) const
|
|||||||
return QString("%1").arg(m_devices[QString(
|
return QString("%1").arg(m_devices[QString(
|
||||||
"net")][key.remove(QRegExp(QString("^(down|up)"))).toInt()]);
|
"net")][key.remove(QRegExp(QString("^(down|up)"))).toInt()]);
|
||||||
else if (key.startsWith(QString("pkgcount")))
|
else if (key.startsWith(QString("pkgcount")))
|
||||||
return extUpgrade->itemByTagNumber(
|
return extUpgrade->itemByTag(key, QString("pkgcount"))->uniq();
|
||||||
key.remove(QString("pkgcount")).toInt())
|
|
||||||
->uniq();
|
|
||||||
else if (key.contains(QRegExp(QString("(^|perc)(ask|bid|price)(chg|)"))))
|
else if (key.contains(QRegExp(QString("(^|perc)(ask|bid|price)(chg|)"))))
|
||||||
return extQuotes->itemByTagNumber(
|
return extQuotes->itemByTag(key, QString("ask"))->uniq();
|
||||||
key.remove(QRegExp(QString(
|
|
||||||
"(^|perc)(ask|bid|price)(chg|)")))
|
|
||||||
.toInt())
|
|
||||||
->uniq();
|
|
||||||
else if (key.contains(QRegExp(
|
else if (key.contains(QRegExp(
|
||||||
QString("(weather|weatherId|humidity|pressure|temperature)"))))
|
QString("(weather|weatherId|humidity|pressure|temperature)"))))
|
||||||
return extWeather
|
return extWeather->itemByTag(key, QString("weather"))->uniq();
|
||||||
->itemByTagNumber(
|
|
||||||
key
|
|
||||||
.remove(QRegExp(QString(
|
|
||||||
"(weather|weatherId|humidity|pressure|temperature)")))
|
|
||||||
.toInt())
|
|
||||||
->uniq();
|
|
||||||
else if (key.startsWith(QString("temp")))
|
else if (key.startsWith(QString("temp")))
|
||||||
return QString("%1").arg(
|
return QString("%1").arg(
|
||||||
m_devices[QString("temp")][key.remove(QString("temp")).toInt()]);
|
m_devices[QString("temp")][key.remove(QString("temp")).toInt()]);
|
||||||
|
@ -205,9 +205,19 @@ void AWKeys::reinitKeys(const QStringList currentKeys)
|
|||||||
m_foundKeys
|
m_foundKeys
|
||||||
= AWPatternFunctions::findKeys(keyOperator->pattern(), currentKeys);
|
= AWPatternFunctions::findKeys(keyOperator->pattern(), currentKeys);
|
||||||
m_foundLambdas = AWPatternFunctions::findLambdas(keyOperator->pattern());
|
m_foundLambdas = AWPatternFunctions::findLambdas(keyOperator->pattern());
|
||||||
|
// generate list of required keys for bars
|
||||||
|
QStringList barKeys;
|
||||||
|
for (auto bar : m_foundBars) {
|
||||||
|
GraphicalItem *item = keyOperator->giByKey(bar);
|
||||||
|
if (item->isCustom())
|
||||||
|
item->setUsedKeys(AWPatternFunctions::findKeys(item->bar(), currentKeys));
|
||||||
|
else
|
||||||
|
item->setUsedKeys(QStringList() << item->bar());
|
||||||
|
barKeys.append(item->usedKeys());
|
||||||
|
}
|
||||||
// get required keys
|
// get required keys
|
||||||
m_requiredKeys
|
m_requiredKeys
|
||||||
= m_optimize ? AWKeyCache::getRequiredKeys(m_foundKeys, m_foundBars,
|
= m_optimize ? AWKeyCache::getRequiredKeys(m_foundKeys, barKeys,
|
||||||
m_tooltipParams, currentKeys)
|
m_tooltipParams, currentKeys)
|
||||||
: QStringList();
|
: QStringList();
|
||||||
|
|
||||||
@ -318,16 +328,29 @@ QString AWKeys::parsePattern(QString pattern) const
|
|||||||
// bars
|
// bars
|
||||||
for (auto bar : m_foundBars) {
|
for (auto bar : m_foundBars) {
|
||||||
GraphicalItem *item = keyOperator->giByKey(bar);
|
GraphicalItem *item = keyOperator->giByKey(bar);
|
||||||
QString key = bar;
|
|
||||||
key.remove(QRegExp(QString("^bar[0-9]{1,}")));
|
|
||||||
if (item->type() == GraphicalItem::Graph)
|
if (item->type() == GraphicalItem::Graph)
|
||||||
pattern.replace(QString("$%1").arg(bar),
|
pattern.replace(QString("$%1").arg(bar),
|
||||||
item->image([](const QList<float> data) {
|
item->image(QVariant::fromValue<QList<float>>(dataAggregator->getData(item->bar()))));
|
||||||
return QVariant::fromValue<QList<float>>(data);
|
else {
|
||||||
}(dataAggregator->getData(key))));
|
if (item->isCustom())
|
||||||
|
pattern.replace(QString("$%1").arg(bar),item->image([this, item](QString bar ){
|
||||||
|
QJSEngine engine;
|
||||||
|
for (auto key : item->usedKeys())
|
||||||
|
bar.replace(QString("$%1").arg(key), aggregator->formater(values[key], key));
|
||||||
|
qCInfo(LOG_AW) << "Expression" << bar;
|
||||||
|
QJSValue result = engine.evaluate(bar);
|
||||||
|
if (result.isError()) {
|
||||||
|
qCWarning(LOG_AW) << "Uncaught exception at line"
|
||||||
|
<< result.property("lineNumber").toInt()
|
||||||
|
<< ":" << result.toString();
|
||||||
|
return QString();
|
||||||
|
} else {
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
}(item->bar())));
|
||||||
else
|
else
|
||||||
pattern.replace(QString("$%1").arg(bar),
|
pattern.replace(QString("$%1").arg(bar),item->image(values[item->bar()]));
|
||||||
item->image(values[key].toFloat()));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// prepare strings
|
// prepare strings
|
||||||
|
@ -539,7 +539,8 @@ QStringList AWKeysAggregator::registerSource(const QString &source,
|
|||||||
// drop key from dictionary if no one user requested key required it
|
// drop key from dictionary if no one user requested key required it
|
||||||
QStringList foundKeys = keysFromSource(source);
|
QStringList foundKeys = keysFromSource(source);
|
||||||
qCInfo(LOG_AW) << "Looking for keys" << foundKeys << "in" << keys;
|
qCInfo(LOG_AW) << "Looking for keys" << foundKeys << "in" << keys;
|
||||||
// let required if key list is empty no one use it
|
// this source is required if list is empty (which means skip checking)
|
||||||
|
// or if key in required key list
|
||||||
bool required
|
bool required
|
||||||
= keys.isEmpty() || std::any_of(foundKeys.cbegin(), foundKeys.cend(),
|
= keys.isEmpty() || std::any_of(foundKeys.cbegin(), foundKeys.cend(),
|
||||||
[&keys](const QString &key) {
|
[&keys](const QString &key) {
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "awdebug.h"
|
#include "awdebug.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "abstractextitemaggregator.h"
|
||||||
|
|
||||||
|
|
||||||
AbstractExtItem::AbstractExtItem(QWidget *parent, const QString desktopName,
|
AbstractExtItem::AbstractExtItem(QWidget *parent, const QString desktopName,
|
||||||
@ -47,10 +48,13 @@ AbstractExtItem::~AbstractExtItem()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T> T *AbstractExtItem::copy(const QString, const int)
|
void AbstractExtItem::copyDefaults(AbstractExtItem *_other) const
|
||||||
{
|
{
|
||||||
// an analog of pure virtual method
|
_other->setActive(m_active);
|
||||||
return new T();
|
_other->setApiVersion(m_apiVersion);
|
||||||
|
_other->setComment(m_comment);
|
||||||
|
_other->setInterval(m_interval);
|
||||||
|
_other->setName(m_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,8 @@ public:
|
|||||||
const QString desktopName = QString(),
|
const QString desktopName = QString(),
|
||||||
const QStringList directories = QStringList());
|
const QStringList directories = QStringList());
|
||||||
virtual ~AbstractExtItem();
|
virtual ~AbstractExtItem();
|
||||||
template <class T> T *copy(const QString, const int);
|
virtual AbstractExtItem *copy(const QString _fileName, const int _number) = 0;
|
||||||
|
void copyDefaults(AbstractExtItem *_other) const;
|
||||||
// get methods
|
// get methods
|
||||||
int apiVersion() const;
|
int apiVersion() const;
|
||||||
QString comment() const;
|
QString comment() const;
|
||||||
|
@ -62,13 +62,13 @@ public:
|
|||||||
qCInfo(LOG_LIB) << "Dialog returns" << ret;
|
qCInfo(LOG_LIB) << "Dialog returns" << ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
T *itemByTag(const QString _tag) const
|
T *itemByTag(const QString _tag, const QString _type) const
|
||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << "Tag" << _tag;
|
qCDebug(LOG_LIB) << "Tag" << _tag << "with used type" << _type;
|
||||||
|
|
||||||
T *found = nullptr;
|
T *found = nullptr;
|
||||||
for (auto item : m_items) {
|
for (auto item : m_items) {
|
||||||
if (item->tag() != _tag)
|
if (item->tag(_type) != _tag)
|
||||||
continue;
|
continue;
|
||||||
found = item;
|
found = item;
|
||||||
break;
|
break;
|
||||||
@ -211,7 +211,7 @@ private:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
T *newItem = source->copy(fileName, number);
|
T *newItem = static_cast<T *>(source->copy(fileName, number));
|
||||||
if (newItem->showConfiguration(configArgs()) == 1) {
|
if (newItem->showConfiguration(configArgs()) == 1) {
|
||||||
initItems();
|
initItems();
|
||||||
repaint();
|
repaint();
|
||||||
|
@ -81,11 +81,7 @@ ExtQuotes *ExtQuotes::copy(const QString _fileName, const int _number)
|
|||||||
|
|
||||||
ExtQuotes *item = new ExtQuotes(static_cast<QWidget *>(parent()), _fileName,
|
ExtQuotes *item = new ExtQuotes(static_cast<QWidget *>(parent()), _fileName,
|
||||||
directories());
|
directories());
|
||||||
item->setActive(isActive());
|
copyDefaults(item);
|
||||||
item->setApiVersion(apiVersion());
|
|
||||||
item->setComment(comment());
|
|
||||||
item->setInterval(interval());
|
|
||||||
item->setName(name());
|
|
||||||
item->setNumber(_number);
|
item->setNumber(_number);
|
||||||
item->setTicker(ticker());
|
item->setTicker(ticker());
|
||||||
|
|
||||||
|
@ -68,12 +68,8 @@ ExtScript *ExtScript::copy(const QString _fileName, const int _number)
|
|||||||
|
|
||||||
ExtScript *item = new ExtScript(static_cast<QWidget *>(parent()), _fileName,
|
ExtScript *item = new ExtScript(static_cast<QWidget *>(parent()), _fileName,
|
||||||
directories());
|
directories());
|
||||||
item->setActive(isActive());
|
copyDefaults(item);
|
||||||
item->setApiVersion(apiVersion());
|
|
||||||
item->setComment(comment());
|
|
||||||
item->setExecutable(executable());
|
item->setExecutable(executable());
|
||||||
item->setInterval(interval());
|
|
||||||
item->setName(name());
|
|
||||||
item->setNumber(_number);
|
item->setNumber(_number);
|
||||||
item->setPrefix(prefix());
|
item->setPrefix(prefix());
|
||||||
item->setRedirect(redirect());
|
item->setRedirect(redirect());
|
||||||
|
@ -64,13 +64,9 @@ ExtUpgrade *ExtUpgrade::copy(const QString _fileName, const int _number)
|
|||||||
|
|
||||||
ExtUpgrade *item = new ExtUpgrade(static_cast<QWidget *>(parent()),
|
ExtUpgrade *item = new ExtUpgrade(static_cast<QWidget *>(parent()),
|
||||||
_fileName, directories());
|
_fileName, directories());
|
||||||
item->setActive(isActive());
|
copyDefaults(item);
|
||||||
item->setApiVersion(apiVersion());
|
|
||||||
item->setComment(comment());
|
|
||||||
item->setExecutable(executable());
|
item->setExecutable(executable());
|
||||||
item->setFilter(filter());
|
item->setFilter(filter());
|
||||||
item->setInterval(interval());
|
|
||||||
item->setName(name());
|
|
||||||
item->setNumber(_number);
|
item->setNumber(_number);
|
||||||
item->setNull(null());
|
item->setNull(null());
|
||||||
|
|
||||||
|
@ -78,14 +78,10 @@ ExtWeather *ExtWeather::copy(const QString _fileName, const int _number)
|
|||||||
|
|
||||||
ExtWeather *item = new ExtWeather(static_cast<QWidget *>(parent()),
|
ExtWeather *item = new ExtWeather(static_cast<QWidget *>(parent()),
|
||||||
_fileName, directories());
|
_fileName, directories());
|
||||||
item->setActive(isActive());
|
copyDefaults(item);
|
||||||
item->setApiVersion(apiVersion());
|
|
||||||
item->setCity(city());
|
item->setCity(city());
|
||||||
item->setComment(comment());
|
|
||||||
item->setCountry(country());
|
item->setCountry(country());
|
||||||
item->setInterval(interval());
|
|
||||||
item->setImage(image());
|
item->setImage(image());
|
||||||
item->setName(name());
|
|
||||||
item->setNumber(_number);
|
item->setNumber(_number);
|
||||||
item->setTs(ts());
|
item->setTs(ts());
|
||||||
|
|
||||||
|
@ -47,6 +47,8 @@ GraphicalItem::GraphicalItem(QWidget *parent, const QString desktopName,
|
|||||||
|
|
||||||
initScene();
|
initScene();
|
||||||
|
|
||||||
|
connect(ui->checkBox_custom, SIGNAL(stateChanged(int)), this,
|
||||||
|
SLOT(changeValue(int)));
|
||||||
connect(ui->pushButton_activeColor, SIGNAL(clicked()), this,
|
connect(ui->pushButton_activeColor, SIGNAL(clicked()), this,
|
||||||
SLOT(changeColor()));
|
SLOT(changeColor()));
|
||||||
connect(ui->pushButton_inactiveColor, SIGNAL(clicked()), this,
|
connect(ui->pushButton_inactiveColor, SIGNAL(clicked()), this,
|
||||||
@ -69,29 +71,26 @@ GraphicalItem *GraphicalItem::copy(const QString _fileName, const int _number)
|
|||||||
|
|
||||||
GraphicalItem *item = new GraphicalItem(static_cast<QWidget *>(parent()),
|
GraphicalItem *item = new GraphicalItem(static_cast<QWidget *>(parent()),
|
||||||
_fileName, directories());
|
_fileName, directories());
|
||||||
item->setActive(isActive());
|
copyDefaults(item);
|
||||||
item->setActiveColor(activeColor());
|
item->setActiveColor(m_activeColor);
|
||||||
item->setApiVersion(apiVersion());
|
item->setBar(m_bar);
|
||||||
item->setBar(bar());
|
item->setCustom(m_custom);
|
||||||
item->setComment(comment());
|
item->setDirection(m_direction);
|
||||||
item->setDirection(direction());
|
item->setHeight(m_height);
|
||||||
item->setHeight(height());
|
item->setInactiveColor(m_inactiveColor);
|
||||||
item->setInactiveColor(inactiveColor());
|
item->setMaxValue(m_maxValue);
|
||||||
item->setInterval(interval());
|
item->setMinValue(m_minValue);
|
||||||
item->setName(QString("bar%1").arg(_number));
|
|
||||||
item->setNumber(_number);
|
item->setNumber(_number);
|
||||||
item->setType(type());
|
item->setType(m_type);
|
||||||
item->setWidth(width());
|
item->setWidth(m_width);
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString GraphicalItem::image(const QVariant value)
|
QString GraphicalItem::image(const QVariant &value)
|
||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << "Value" << value;
|
qCDebug(LOG_LIB) << "Value" << value;
|
||||||
if (m_bar == QString("none"))
|
|
||||||
return QString("");
|
|
||||||
|
|
||||||
m_scene->clear();
|
m_scene->clear();
|
||||||
int scale[2] = {1, 1};
|
int scale[2] = {1, 1};
|
||||||
@ -151,9 +150,21 @@ QString GraphicalItem::inactiveColor() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString GraphicalItem::tag() const
|
bool GraphicalItem::isCustom() const
|
||||||
{
|
{
|
||||||
return QString("bar%1%2").arg(number()).arg(m_bar);
|
return m_custom;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float GraphicalItem::maxValue() const
|
||||||
|
{
|
||||||
|
return m_maxValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
float GraphicalItem::minValue() const
|
||||||
|
{
|
||||||
|
return m_minValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -215,6 +226,12 @@ int GraphicalItem::height() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QStringList GraphicalItem::usedKeys() const
|
||||||
|
{
|
||||||
|
return m_usedKeys;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int GraphicalItem::width() const
|
int GraphicalItem::width() const
|
||||||
{
|
{
|
||||||
return m_width;
|
return m_width;
|
||||||
@ -231,14 +248,8 @@ void GraphicalItem::setBar(const QString _bar)
|
|||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << "Bar" << _bar;
|
qCDebug(LOG_LIB) << "Bar" << _bar;
|
||||||
|
|
||||||
if (!_bar.contains(QRegExp(
|
|
||||||
QString("^(cpu(?!cl).*|gpu$|mem$|swap$|hdd[0-9].*|bat.*)")))) {
|
|
||||||
qCWarning(LOG_LIB) << "Unsupported bar type" << _bar;
|
|
||||||
m_bar = QString("none");
|
|
||||||
} else {
|
|
||||||
m_bar = _bar;
|
m_bar = _bar;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void GraphicalItem::setActiveColor(const QString _color)
|
void GraphicalItem::setActiveColor(const QString _color)
|
||||||
@ -249,6 +260,14 @@ void GraphicalItem::setActiveColor(const QString _color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GraphicalItem::setCustom(const bool _custom)
|
||||||
|
{
|
||||||
|
qCDebug(LOG_LIB) << "Use custom tag" << _custom;
|
||||||
|
|
||||||
|
m_custom = _custom;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GraphicalItem::setInactiveColor(const QString _color)
|
void GraphicalItem::setInactiveColor(const QString _color)
|
||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << "Color" << _color;
|
qCDebug(LOG_LIB) << "Color" << _color;
|
||||||
@ -257,6 +276,22 @@ void GraphicalItem::setInactiveColor(const QString _color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GraphicalItem::setMaxValue(const float _value)
|
||||||
|
{
|
||||||
|
qCDebug(LOG_LIB) << "Max value" << _value;
|
||||||
|
|
||||||
|
m_maxValue = _value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GraphicalItem::setMinValue(const float _value)
|
||||||
|
{
|
||||||
|
qCDebug(LOG_LIB) << "Min value" << _value;
|
||||||
|
|
||||||
|
m_minValue = _value;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GraphicalItem::setType(const Type _type)
|
void GraphicalItem::setType(const Type _type)
|
||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << "Type" << _type;
|
qCDebug(LOG_LIB) << "Type" << _type;
|
||||||
@ -309,6 +344,15 @@ void GraphicalItem::setHeight(const int _height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GraphicalItem::setUsedKeys(const QStringList _usedKeys)
|
||||||
|
{
|
||||||
|
qCDebug(LOG_LIB) << "Used keys" << _usedKeys;
|
||||||
|
|
||||||
|
// remove dubs
|
||||||
|
m_usedKeys = QSet<QString>::fromList(_usedKeys).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GraphicalItem::setWidth(const int _width)
|
void GraphicalItem::setWidth(const int _width)
|
||||||
{
|
{
|
||||||
qCDebug(LOG_LIB) << "Width" << _width;
|
qCDebug(LOG_LIB) << "Width" << _width;
|
||||||
@ -333,7 +377,10 @@ void GraphicalItem::readConfiguration()
|
|||||||
QSettings::IniFormat);
|
QSettings::IniFormat);
|
||||||
|
|
||||||
settings.beginGroup(QString("Desktop Entry"));
|
settings.beginGroup(QString("Desktop Entry"));
|
||||||
|
setCustom(settings.value(QString("X-AW-Custom"), m_custom).toBool());
|
||||||
setBar(settings.value(QString("X-AW-Value"), m_bar).toString());
|
setBar(settings.value(QString("X-AW-Value"), m_bar).toString());
|
||||||
|
setMaxValue(settings.value(QString("X-AW-Max"), m_maxValue).toFloat());
|
||||||
|
setMinValue(settings.value(QString("X-AW-Min"), m_minValue).toFloat());
|
||||||
setActiveColor(
|
setActiveColor(
|
||||||
settings.value(QString("X-AW-ActiveColor"), m_activeColor)
|
settings.value(QString("X-AW-ActiveColor"), m_activeColor)
|
||||||
.toString());
|
.toString());
|
||||||
@ -374,11 +421,18 @@ int GraphicalItem::showConfiguration(const QVariant args)
|
|||||||
qCDebug(LOG_LIB) << "Combobox arguments" << args;
|
qCDebug(LOG_LIB) << "Combobox arguments" << args;
|
||||||
QStringList tags = args.toStringList();
|
QStringList tags = args.toStringList();
|
||||||
|
|
||||||
ui->label_nameValue->setText(name());
|
ui->lineEdit_name->setText(name());
|
||||||
ui->lineEdit_comment->setText(comment());
|
ui->lineEdit_comment->setText(comment());
|
||||||
|
ui->checkBox_custom->setChecked(m_custom);
|
||||||
ui->comboBox_value->addItems(tags);
|
ui->comboBox_value->addItems(tags);
|
||||||
|
if (m_custom) {
|
||||||
|
ui->lineEdit_customValue->setText(m_bar);
|
||||||
|
} else {
|
||||||
ui->comboBox_value->addItem(m_bar);
|
ui->comboBox_value->addItem(m_bar);
|
||||||
ui->comboBox_value->setCurrentIndex(ui->comboBox_value->count() - 1);
|
ui->comboBox_value->setCurrentIndex(ui->comboBox_value->count() - 1);
|
||||||
|
}
|
||||||
|
ui->doubleSpinBox_max->setValue(m_maxValue);
|
||||||
|
ui->doubleSpinBox_min->setValue(m_minValue);
|
||||||
ui->pushButton_activeColor->setText(m_activeColor);
|
ui->pushButton_activeColor->setText(m_activeColor);
|
||||||
ui->pushButton_inactiveColor->setText(m_inactiveColor);
|
ui->pushButton_inactiveColor->setText(m_inactiveColor);
|
||||||
ui->comboBox_type->setCurrentIndex(static_cast<int>(m_type));
|
ui->comboBox_type->setCurrentIndex(static_cast<int>(m_type));
|
||||||
@ -389,10 +443,13 @@ int GraphicalItem::showConfiguration(const QVariant args)
|
|||||||
int ret = exec();
|
int ret = exec();
|
||||||
if (ret != 1)
|
if (ret != 1)
|
||||||
return ret;
|
return ret;
|
||||||
setName(ui->label_nameValue->text());
|
setName(ui->lineEdit_name->text());
|
||||||
setComment(ui->lineEdit_comment->text());
|
setComment(ui->lineEdit_comment->text());
|
||||||
setApiVersion(AWGIAPI);
|
setApiVersion(AWGIAPI);
|
||||||
setBar(ui->comboBox_value->currentText());
|
setCustom(ui->checkBox_custom->isChecked());
|
||||||
|
setBar(m_custom ? ui->lineEdit_customValue->text() : ui->comboBox_value->currentText());
|
||||||
|
setMaxValue(ui->doubleSpinBox_max->value());
|
||||||
|
setMinValue(ui->doubleSpinBox_min->value());
|
||||||
setActiveColor(ui->pushButton_activeColor->text().remove(QChar('&')));
|
setActiveColor(ui->pushButton_activeColor->text().remove(QChar('&')));
|
||||||
setInactiveColor(ui->pushButton_inactiveColor->text().remove(QChar('&')));
|
setInactiveColor(ui->pushButton_inactiveColor->text().remove(QChar('&')));
|
||||||
setStrType(ui->comboBox_type->currentText());
|
setStrType(ui->comboBox_type->currentText());
|
||||||
@ -416,6 +473,9 @@ void GraphicalItem::writeConfiguration() const
|
|||||||
|
|
||||||
settings.beginGroup(QString("Desktop Entry"));
|
settings.beginGroup(QString("Desktop Entry"));
|
||||||
settings.setValue(QString("X-AW-Value"), m_bar);
|
settings.setValue(QString("X-AW-Value"), m_bar);
|
||||||
|
settings.setValue(QString("X-AW-Custom"), m_custom);
|
||||||
|
settings.setValue(QString("X-AW-Max"), m_maxValue);
|
||||||
|
settings.setValue(QString("X-AW-Min"), m_minValue);
|
||||||
settings.setValue(QString("X-AW-ActiveColor"), m_activeColor);
|
settings.setValue(QString("X-AW-ActiveColor"), m_activeColor);
|
||||||
settings.setValue(QString("X-AW-InactiveColor"), m_inactiveColor);
|
settings.setValue(QString("X-AW-InactiveColor"), m_inactiveColor);
|
||||||
settings.setValue(QString("X-AW-Type"), strType());
|
settings.setValue(QString("X-AW-Type"), strType());
|
||||||
@ -449,6 +509,15 @@ void GraphicalItem::changeColor()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GraphicalItem::changeValue(const int state)
|
||||||
|
{
|
||||||
|
qCDebug(LOG_LIB) << "Current state is" << state;
|
||||||
|
|
||||||
|
ui->widget_value->setHidden(state == Qt::Unchecked);
|
||||||
|
ui->widget_customValue->setHidden(state != Qt::Unchecked);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GraphicalItem::initScene()
|
void GraphicalItem::initScene()
|
||||||
{
|
{
|
||||||
// init scene
|
// init scene
|
||||||
@ -464,15 +533,15 @@ void GraphicalItem::initScene()
|
|||||||
m_view->setFrameShape(QFrame::NoFrame);
|
m_view->setFrameShape(QFrame::NoFrame);
|
||||||
m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||||
m_view->resize(m_width + 5.0, m_height + 5.0);
|
m_view->resize(m_width + 5, m_height + 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GraphicalItem::paintCircle(const float value)
|
void GraphicalItem::paintCircle(const float value)
|
||||||
{
|
{
|
||||||
QPen pen;
|
QPen pen;
|
||||||
pen.setWidth(1.0);
|
pen.setWidth(1);
|
||||||
float percent = value / 100.0;
|
float percent = (value - m_minValue) / (m_maxValue - m_minValue);
|
||||||
QGraphicsEllipseItem *circle;
|
QGraphicsEllipseItem *circle;
|
||||||
|
|
||||||
QColor inactive = stringToColor(m_inactiveColor);
|
QColor inactive = stringToColor(m_inactiveColor);
|
||||||
@ -482,14 +551,14 @@ void GraphicalItem::paintCircle(const float value)
|
|||||||
pen.setColor(inactive);
|
pen.setColor(inactive);
|
||||||
circle = m_scene->addEllipse(0.0, 0.0, m_width, m_height, pen,
|
circle = m_scene->addEllipse(0.0, 0.0, m_width, m_height, pen,
|
||||||
QBrush(inactive, Qt::SolidPattern));
|
QBrush(inactive, Qt::SolidPattern));
|
||||||
circle->setSpanAngle(-(1.0 - percent) * 360.0 * 16.0);
|
circle->setSpanAngle(-(1.0f - percent) * 360.0f * 16.0f);
|
||||||
circle->setStartAngle(90.0 * 16.0 - percent * 360.0 * 16.0);
|
circle->setStartAngle(90.0f * 16.0f - percent * 360.0f * 16.0f);
|
||||||
// active
|
// active
|
||||||
pen.setColor(active);
|
pen.setColor(active);
|
||||||
circle = m_scene->addEllipse(0.0, 0.0, m_width, m_height, pen,
|
circle = m_scene->addEllipse(0.0, 0.0, m_width, m_height, pen,
|
||||||
QBrush(active, Qt::SolidPattern));
|
QBrush(active, Qt::SolidPattern));
|
||||||
circle->setSpanAngle(-percent * 360.0 * 16.0);
|
circle->setSpanAngle(-percent * 360.0f * 16.0f);
|
||||||
circle->setStartAngle(90.0 * 16.0);
|
circle->setStartAngle(90.0f * 16.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -501,14 +570,14 @@ void GraphicalItem::paintGraph(const QList<float> value)
|
|||||||
// default norms
|
// default norms
|
||||||
float normX
|
float normX
|
||||||
= static_cast<float>(m_width) / static_cast<float>(value.count());
|
= static_cast<float>(m_width) / static_cast<float>(value.count());
|
||||||
float normY = static_cast<float>(m_height) / (1.5 * 100.0);
|
float normY = static_cast<float>(m_height) / (1.5f * 100.0f);
|
||||||
// paint graph
|
// paint graph
|
||||||
for (int i = 0; i < value.count() - 1; i++) {
|
for (int i = 0; i < value.count() - 1; i++) {
|
||||||
// some magic here
|
// some magic here
|
||||||
float x1 = i * normX;
|
float x1 = i * normX;
|
||||||
float y1 = -fabs(value.at(i)) * normY + 5.0;
|
float y1 = -fabs(value.at(i)) * normY + 5.0f;
|
||||||
float x2 = (i + 1) * normX;
|
float x2 = (i + 1) * normX;
|
||||||
float y2 = -fabs(value.at(i + 1)) * normY + 5.0;
|
float y2 = -fabs(value.at(i + 1)) * normY + 5.0f;
|
||||||
m_scene->addLine(x1, y1, x2, y2, pen);
|
m_scene->addLine(x1, y1, x2, y2, pen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -517,7 +586,7 @@ void GraphicalItem::paintGraph(const QList<float> value)
|
|||||||
void GraphicalItem::paintHorizontal(const float value)
|
void GraphicalItem::paintHorizontal(const float value)
|
||||||
{
|
{
|
||||||
QPen pen;
|
QPen pen;
|
||||||
float percent = value / 100.0;
|
float percent = (value - m_minValue) / (m_maxValue - m_minValue);
|
||||||
|
|
||||||
pen.setWidth(m_height);
|
pen.setWidth(m_height);
|
||||||
// inactive
|
// inactive
|
||||||
@ -534,7 +603,7 @@ void GraphicalItem::paintHorizontal(const float value)
|
|||||||
void GraphicalItem::paintVertical(const float value)
|
void GraphicalItem::paintVertical(const float value)
|
||||||
{
|
{
|
||||||
QPen pen;
|
QPen pen;
|
||||||
float percent = value / 100.0;
|
float percent = (value - m_minValue) / (m_maxValue - m_minValue);
|
||||||
|
|
||||||
pen.setWidth(m_width);
|
pen.setWidth(m_width);
|
||||||
// inactive
|
// inactive
|
||||||
@ -569,7 +638,11 @@ void GraphicalItem::translate()
|
|||||||
{
|
{
|
||||||
ui->label_name->setText(i18n("Name"));
|
ui->label_name->setText(i18n("Name"));
|
||||||
ui->label_comment->setText(i18n("Comment"));
|
ui->label_comment->setText(i18n("Comment"));
|
||||||
|
ui->checkBox_custom->setText(i18n("Use custom formula"));
|
||||||
ui->label_value->setText(i18n("Value"));
|
ui->label_value->setText(i18n("Value"));
|
||||||
|
ui->label_customValue->setText(i18n("Value"));
|
||||||
|
ui->label_max->setText(i18n("Max value"));
|
||||||
|
ui->label_min->setText(i18n("Min value"));
|
||||||
ui->label_activeColor->setText(i18n("Active color"));
|
ui->label_activeColor->setText(i18n("Active color"));
|
||||||
ui->label_inactiveColor->setText(i18n("Inactive color"));
|
ui->label_inactiveColor->setText(i18n("Inactive color"));
|
||||||
ui->label_type->setText(i18n("Type"));
|
ui->label_type->setText(i18n("Type"));
|
||||||
|
@ -36,10 +36,14 @@ class GraphicalItem : public AbstractExtItem
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString bar READ bar WRITE setBar)
|
Q_PROPERTY(QString bar READ bar WRITE setBar)
|
||||||
Q_PROPERTY(QString activeColor READ activeColor WRITE setActiveColor)
|
Q_PROPERTY(QString activeColor READ activeColor WRITE setActiveColor)
|
||||||
|
Q_PROPERTY(bool custom READ isCustom WRITE setCustom)
|
||||||
Q_PROPERTY(QString inactiveColor READ inactiveColor WRITE setInactiveColor)
|
Q_PROPERTY(QString inactiveColor READ inactiveColor WRITE setInactiveColor)
|
||||||
Q_PROPERTY(Type type READ type WRITE setType)
|
Q_PROPERTY(Type type READ type WRITE setType)
|
||||||
Q_PROPERTY(Direction direction READ direction WRITE setDirection)
|
Q_PROPERTY(Direction direction READ direction WRITE setDirection)
|
||||||
Q_PROPERTY(int height READ height WRITE setHeight)
|
Q_PROPERTY(int height READ height WRITE setHeight)
|
||||||
|
Q_PROPERTY(float maxValue READ maxValue WRITE setMaxValue)
|
||||||
|
Q_PROPERTY(float minValue READ minValue WRITE setMinValue)
|
||||||
|
Q_PROPERTY(QStringList usedKeys READ usedKeys WRITE setUsedKeys)
|
||||||
Q_PROPERTY(int width READ width WRITE setWidth)
|
Q_PROPERTY(int width READ width WRITE setWidth)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -51,28 +55,35 @@ public:
|
|||||||
const QStringList directories = QStringList());
|
const QStringList directories = QStringList());
|
||||||
virtual ~GraphicalItem();
|
virtual ~GraphicalItem();
|
||||||
GraphicalItem *copy(const QString _fileName, const int _number);
|
GraphicalItem *copy(const QString _fileName, const int _number);
|
||||||
QString image(const QVariant value);
|
QString image(const QVariant &value);
|
||||||
// get methods
|
// get methods
|
||||||
QString bar() const;
|
QString bar() const;
|
||||||
QString activeColor() const;
|
QString activeColor() const;
|
||||||
QString inactiveColor() const;
|
QString inactiveColor() const;
|
||||||
QString tag() const;
|
bool isCustom() const;
|
||||||
|
float minValue() const;
|
||||||
|
float maxValue() const;
|
||||||
Type type() const;
|
Type type() const;
|
||||||
QString strType() const;
|
QString strType() const;
|
||||||
Direction direction() const;
|
Direction direction() const;
|
||||||
QString strDirection() const;
|
QString strDirection() const;
|
||||||
int height() const;
|
int height() const;
|
||||||
|
QStringList usedKeys() const;
|
||||||
int width() const;
|
int width() const;
|
||||||
QString uniq() const;
|
QString uniq() const;
|
||||||
// set methods
|
// set methods
|
||||||
void setBar(const QString _bar = QString("cpu"));
|
void setBar(const QString _bar = QString("cpu"));
|
||||||
void setActiveColor(const QString _color = QString("0,0,0,130"));
|
void setActiveColor(const QString _color = QString("0,0,0,130"));
|
||||||
|
void setCustom(const bool _custom);
|
||||||
void setInactiveColor(const QString _color = QString("255,255,255,130"));
|
void setInactiveColor(const QString _color = QString("255,255,255,130"));
|
||||||
|
void setMinValue(const float _value);
|
||||||
|
void setMaxValue(const float _value);
|
||||||
void setType(const Type _type = Horizontal);
|
void setType(const Type _type = Horizontal);
|
||||||
void setStrType(const QString _type = QString("Horizontal"));
|
void setStrType(const QString _type = QString("Horizontal"));
|
||||||
void setDirection(const Direction _direction = LeftToRight);
|
void setDirection(const Direction _direction = LeftToRight);
|
||||||
void setStrDirection(const QString _direction = QString("LeftToRight"));
|
void setStrDirection(const QString _direction = QString("LeftToRight"));
|
||||||
void setHeight(const int _height = 100);
|
void setHeight(const int _height = 100);
|
||||||
|
void setUsedKeys(const QStringList _usedKeys = QStringList());
|
||||||
void setWidth(const int _width = 100);
|
void setWidth(const int _width = 100);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@ -83,10 +94,9 @@ public slots:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void changeColor();
|
void changeColor();
|
||||||
|
void changeValue(const int state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString m_fileName;
|
|
||||||
QStringList m_dirs;
|
|
||||||
QGraphicsScene *m_scene = nullptr;
|
QGraphicsScene *m_scene = nullptr;
|
||||||
QGraphicsView *m_view = nullptr;
|
QGraphicsView *m_view = nullptr;
|
||||||
Ui::GraphicalItem *ui;
|
Ui::GraphicalItem *ui;
|
||||||
@ -101,11 +111,15 @@ private:
|
|||||||
void translate();
|
void translate();
|
||||||
// properties
|
// properties
|
||||||
QString m_bar = QString("cpu");
|
QString m_bar = QString("cpu");
|
||||||
|
bool m_custom = false;
|
||||||
QString m_activeColor = QString("0,0,0,130");
|
QString m_activeColor = QString("0,0,0,130");
|
||||||
QString m_inactiveColor = QString("255,255,255,130");
|
QString m_inactiveColor = QString("255,255,255,130");
|
||||||
|
float m_minValue = 0.0f;
|
||||||
|
float m_maxValue = 100.0f;
|
||||||
Type m_type = Horizontal;
|
Type m_type = Horizontal;
|
||||||
Direction m_direction = LeftToRight;
|
Direction m_direction = LeftToRight;
|
||||||
int m_height = 100;
|
int m_height = 100;
|
||||||
|
QStringList m_usedKeys;
|
||||||
int m_width = 100;
|
int m_width = 100;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>416</width>
|
<width>416</width>
|
||||||
<height>325</height>
|
<height>461</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -18,6 +18,12 @@
|
|||||||
<layout class="QHBoxLayout" name="layout_name">
|
<layout class="QHBoxLayout" name="layout_name">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_name">
|
<widget class="QLabel" name="label_name">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Name</string>
|
<string>Name</string>
|
||||||
</property>
|
</property>
|
||||||
@ -27,11 +33,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_nameValue">
|
<widget class="QLineEdit" name="lineEdit_name"/>
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
@ -59,6 +61,44 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
<widget class="Line" name="line_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="layout_custom">
|
||||||
|
<item>
|
||||||
|
<spacer name="spacer_custom">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox_custom">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Use custom formula</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_value" native="true">
|
||||||
<layout class="QHBoxLayout" name="layout_value">
|
<layout class="QHBoxLayout" name="layout_value">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_value">
|
<widget class="QLabel" name="label_value">
|
||||||
@ -78,6 +118,81 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QWidget" name="widget_customValue" native="true">
|
||||||
|
<layout class="QHBoxLayout" name="layout_customValue">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_customValue">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Value</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="lineEdit_customValue"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="layout_max">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_max">
|
||||||
|
<property name="text">
|
||||||
|
<string>Max value</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="doubleSpinBox_max">
|
||||||
|
<property name="maximum">
|
||||||
|
<double>9999.989999999999782</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="layout_min">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_min">
|
||||||
|
<property name="text">
|
||||||
|
<string>Min value</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDoubleSpinBox" name="doubleSpinBox_min">
|
||||||
|
<property name="maximum">
|
||||||
|
<double>9999.989999999999782</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="layout_activeColor">
|
<layout class="QHBoxLayout" name="layout_activeColor">
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
// configuraion
|
// configuraion
|
||||||
// graphical items api version
|
// graphical items api version
|
||||||
#define AWGIAPI 3
|
#define AWGIAPI 4
|
||||||
// extquotes api version
|
// extquotes api version
|
||||||
#define AWEQAPI 3
|
#define AWEQAPI 3
|
||||||
// extscript api version
|
// extscript api version
|
||||||
|
Loading…
Reference in New Issue
Block a user