#include <QUrlQuery>
#include <QDebug>

int main() {
    // 创建一个查询对象
    QUrlQuery query;
    query.addQueryItem("name", "Alice");
    query.addQueryItem("age", "30");
    query.addQueryItem("city", "NewYork");
    query.addQueryItem("gender", "female");

    // 获取所有的查询参数
    QList<QPair<QString, QString>> items = query.queryItems();

    // 遍历并输出键值对
    for (const QPair<QString, QString>& item: items) {
        qDebug() << "Key:" << item.first << ", Value:" << item.second;
    }

    return 0;
}
