3

私の DB からのデータは QVariantList にあり、それをループして firstname を取得したいと考えています。

QVariantList sqlData = database->loadDatabase("quotes.db", "quotes");
for (int i = 1; i <= sqlData.size(); i++)
    {
        qDebug() << sqlData.value(i);
    }

これにより、次が生成されます。

Debug: QVariant(QVariantMap, QMap(("firstname", QVariant(QString, "Glenford") ) ( "id" ,  QVariant(qlonglong, 2) ) ( "lastname" ,  QVariant(QString, "Myers") ) ( "quote" ,  QVariant(QString, "We try to solve the problem by rushing through the design process so that enough time will be left at the end of the project to uncover errors that were made because we rushed through the design process.") ) )  ) 

「firstname」の値をデバッグするにはどうすればよいですか? 例 debug = Glenford.

ありがとう

4

1 に答える 1