12345678910111213141516171819202122232425262728293031 |
- #include "loadingcolortab.h"
- loadingColorTab::loadingColorTab()
- {
- }
- void loadingColorTab::updateLabels(QString jsonData)
- {
- //Convert the jsonData var to QJsonObject
- QJsonDocument jsonDataDocument = QJsonDocument::fromJson(jsonData.toUtf8());
- QJsonObject jsonDataDocumentObject = jsonDataDocument.object();
- //Convert the colors in the JSON to QColor
- QColor labelLoadingIconColor, labelLoadingTextColor, labelFreTextColor, labelVersionTextColor, labelPercentageTextColor;
- labelLoadingIconColor.setNamedColor("#" + jsonDataDocumentObject.value("loadingColor").toString());
- labelLoadingTextColor.setNamedColor("#" + jsonDataDocumentObject.value("loadingText").toString());
- labelFreTextColor.setNamedColor("#" + jsonDataDocumentObject.value("freText").toString());
- labelVersionTextColor.setNamedColor("#" + jsonDataDocumentObject.value("versionText").toString());
- labelPercentageTextColor.setNamedColor("#" + jsonDataDocumentObject.value("percentageText").toString());
- //Update labels color
- emit setLabelsColor(labelLoadingIconColor, labelLoadingTextColor, labelFreTextColor, labelVersionTextColor, labelPercentageTextColor);
- }
- QColor loadingColorTab::getColorFromUser()
- {
- //Open the Color Selector dialog
- return QColorDialog::getColor();
- }
|