12345678910111213141516171819202122232425262728293031 |
- #include "dialogboxestab.h"
- dialogBoxesTab::dialogBoxesTab()
- {
- }
- void dialogBoxesTab::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 labelBoxColor, labelBoxOutlineColor, labelDialogBackground, labelDialogButton, labelDialogButtonText;
- labelBoxColor.setNamedColor("#" + jsonDataDocumentObject.value("boxColor").toString());
- labelBoxOutlineColor.setNamedColor("#" + jsonDataDocumentObject.value("boxOutlineColor").toString());
- labelDialogBackground.setNamedColor("#" + jsonDataDocumentObject.value("dialogBackground").toString());
- labelDialogButton.setNamedColor("#" + jsonDataDocumentObject.value("dialogButton").toString());
- labelDialogButtonText.setNamedColor("#" + jsonDataDocumentObject.value("dialogButtonText").toString());
- //Update labels color
- emit setLabelsColor(labelBoxColor, labelBoxOutlineColor, labelDialogBackground, labelDialogButton, labelDialogButtonText);
- }
- QColor dialogBoxesTab::getColorFromUser()
- {
- //Open the Color Selector dialog
- return QColorDialog::getColor();
- }
|