version 2.0.0_alpha

Important! All QtWraps macros renamed!
Qt 6 support
Graphic export feature
qad_types cross-Qt small changes
This commit is contained in:
2021-03-05 13:05:23 +03:00
parent add26cf9ad
commit 7b011ed242
46 changed files with 815 additions and 219 deletions

View File

@@ -303,6 +303,9 @@ QPIConfig::QPIConfig(const QString & path, QStringList dirs) {
return;
}
dev->close();
#if QT_VERSION_MAJOR > 5
stream.setEncoding(QStringConverter::Utf8);
#endif
setFileName(cp);
open(QIODevice::ReadOnly);
parse();
@@ -347,7 +350,15 @@ void QPIConfig::setString(QString * str) {
void QPIConfig::setCodec(const char * codecName) {
codec = codecName;
#if QT_VERSION_MAJOR <= 5
stream.setCodec(codecName);
#else
QString cn = QString(codecName).toLower().remove(' ').remove('-').trimmed();
QStringConverter::Encoding sc = QStringConverter::System;
if (cn == "utf8" ) sc = QStringConverter::Utf8 ;
else if (cn == "utf16") sc = QStringConverter::Utf16;
stream.setEncoding(sc);
#endif
parse();
}
@@ -770,8 +781,10 @@ void QPIConfig::parse(QString content) {
stream.seek(0);
other.clear();
lines = centry = 0;
#if QT_VERSION_MAJOR <= 5
if (!codec.isEmpty())
stream.setCodec(codec.toLatin1().data());
#endif
while (!stream.atEnd()) {
other.push_back(QString());
src = str = parseLine(stream.readLine());