Skip to content

Commit

Permalink
Add quoteString to Contemporary QML attached property
Browse files Browse the repository at this point in the history
  • Loading branch information
vicr123 committed Jun 16, 2024
1 parent fbb88c3 commit b9d2870
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ void ContemporaryStyle::setColorTheme(ColorTheme colorTheme) {
emit colorThemeChanged();
}

QString ContemporaryStyle::quoteString(QString string) {
return QLocale().quoteString(string);
}

QString ContemporaryStyle::quoteString(QString locale, QString string) {
return QLocale(locale).quoteString(string);
}

QColor ContemporaryStyle::readColor(const QJsonValue& jsonColor) {
QJsonArray colorArray = jsonColor.toArray();
return {colorArray[0].toInt(), colorArray[1].toInt(), colorArray[2].toInt(), colorArray.size() == 4 ? colorArray[3].toInt() : 255};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class ContemporaryStyle : public QObject {
// ReSharper disable once CppRedundantQualifier
Q_INVOKABLE void setColorTheme(ContemporaryStyle::ColorTheme colorTheme);

Q_INVOKABLE QString quoteString(QString string);
Q_INVOKABLE QString quoteString(QString locale, QString string);

signals:
void accentChanged();
void backgroundChanged();
Expand Down
Loading

0 comments on commit b9d2870

Please sign in to comment.