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:
parent
e9cd43f369
commit
37d612ba74
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user