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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user