mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-10 04:15:51 +00:00
one more optimization
The previous versions stored values as string, so any (even if they are not used) values being converted into string, and then (if required) being converted back to float/int/etc. I've changed the mechanism, so they are stored as QVariant (native value). Please note that it is possible that this rewrite may cause crash in some cases (if I've missed smth).
This commit is contained in:
@ -41,11 +41,11 @@ public:
|
||||
QPixmap tooltipImage();
|
||||
|
||||
signals:
|
||||
void updateData(const QHash<QString, QString> &values);
|
||||
void updateData(const QVariantHash &values);
|
||||
void toolTipPainted(const QString image) const;
|
||||
|
||||
public slots:
|
||||
void dataUpdate(const QHash<QString, QString> &values);
|
||||
void dataUpdate(const QVariantHash &values);
|
||||
|
||||
private:
|
||||
// ui
|
||||
@ -59,9 +59,9 @@ private:
|
||||
QString notificationText(const QString source, const float value) const;
|
||||
QString notificationText(const QString source, const QString value) const;
|
||||
// main method
|
||||
void setData(const QHash<QString, QString> &values);
|
||||
void setData(const QVariantHash &values);
|
||||
void setData(const QString &source, float value,
|
||||
const float extremum = -1.0);
|
||||
const float extremum = -1.0f);
|
||||
// different signature for battery device
|
||||
void setData(const bool dontInvert, const QString &source, float value);
|
||||
// variables
|
||||
|
Reference in New Issue
Block a user