diff --git a/acss.pri b/acss.pri index eaa3ee3..fc9d504 100644 --- a/acss.pri +++ b/acss.pri @@ -1,13 +1,16 @@ CONFIG(debug, debug|release){ - win32 { + win32-g++ { versionAtLeast(QT_VERSION, 5.15.0) { - LIBS += -lqtadvancedcss + LIBS += -lqtadvancedcss } else { - LIBS += -lqtadvancedcssd + LIBS += -lqtadvancedcssd } } + else:msvc { + LIBS += -lqtadvancedcssd + } else:mac { LIBS += -lqtadvancedcss_debug } diff --git a/src/QtAdvancedStylesheet.cpp b/src/QtAdvancedStylesheet.cpp index 9ffc9ca..4752cc2 100644 --- a/src/QtAdvancedStylesheet.cpp +++ b/src/QtAdvancedStylesheet.cpp @@ -48,6 +48,7 @@ #include #include #include +#include namespace acss @@ -404,12 +405,16 @@ void QtAdvancedStylesheetPrivate::replaceStylesheetVariables(QString& Content) QString ValueString; QString MatchString = match.captured(); // Use only the value inside of the brackets {{ }} without the brackets - auto TemplateVariable = MatchString.midRef(2, MatchString.size() - 4); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + auto TemplateVariable = QStringView(MatchString).mid(2, MatchString.size() - 4); +#else + auto TemplateVariable = QStringView(MatchString).sliced(2, MatchString.size() - 4); +#endif bool HasOpacity = TemplateVariable.endsWith(')'); if (HasOpacity) { - auto Values = TemplateVariable.split("|"); + auto Values = TemplateVariable.split(QChar('|')); ValueString = _this->themeVariableValue(Values[0].toString()); auto OpacityStr = Values[1].mid(OpacityStrSize, Values[1].size() - OpacityStrSize - 1); bool Ok; @@ -525,7 +530,7 @@ bool QtAdvancedStylesheetPrivate::parseVariablesFromXml( if (s.name() != TagName) { setError(QtAdvancedStylesheet::ThemeXmlError, "Malformed theme " - "file - expected tag <" + TagName + "> instead of " + s.name()); + "file - expected tag <" + TagName + "> instead of " + s.name().toString()); return false; } auto Name = s.attributes().value("name"); @@ -559,10 +564,10 @@ bool QtAdvancedStylesheetPrivate::parseThemeFile(const QString& Theme) ThemeFile.open(QIODevice::ReadOnly); QXmlStreamReader s(&ThemeFile); s.readNextStartElement(); - if (s.name() != "resources") + if (s.name() != QLatin1String("resources")) { setError(QtAdvancedStylesheet::ThemeXmlError, "Malformed theme file - " - "expected tag instead of " + s.name()); + "expected tag instead of " + s.name().toString()); return false; }