1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00

fix data lost in = between ordereddictionary and dictionary

This commit is contained in:
tianduanrui 2020-04-14 11:25:34 +08:00
parent e9cd43f369
commit 37d612ba74
3 changed files with 11 additions and 2 deletions

View File

@ -1882,7 +1882,7 @@ void parseOrderedDictionary ( QQtDictionary& node, const QQtOrderedDictionary& o
for ( int i = 0; i < obj.getList().size(); i++ )
{
const QQtOrderedDictionary& value = obj.getList() [i];
parseOrderedDictionary ( node, value );
parseOrderedDictionary ( node[i], value );
}
}
break;

View File

@ -2329,7 +2329,7 @@ void parseDictionary ( QQtOrderedDictionary& node, const QQtDictionary& obj )
for ( int i = 0; i < obj.getList().size(); i++ )
{
const QQtDictionary& value = obj.getList() [i];
parseDictionary ( node, value );
parseDictionary ( node[i], value );
}
}
break;

View File

@ -134,6 +134,15 @@ MainWindow::MainWindow ( QWidget* parent ) :
ui->textBrowser_4->append ( qPrintable ( m4.toXML ( 4 ) ) );
QQtDictionary dict;
dict["Hello"][1] = "A1";
dict["But"][2]["你好"] = "B";
pline() << "sorted dict" << qPrintable ( dict.toJson ( QJsonDocument::Indented ) ) ;
QQtOrderedDictionary dict1;
dict1 = dict;
pline() << "ordered dict:" << qPrintable ( dict1.toJson ( 4 ) ) ;
}
MainWindow::~MainWindow()