Skip to content

How to get list results from QVariant #98

Answered by usiems
RuoyanMeng asked this question in Q&A
Discussion options

You must be logged in to vote
QVariantList resultList = result.toList();
int a = resultList[0].toInt();
int b = resultList[1].toInt();

This is without any type checking, but I guess the important part is the toList() method. Simply have a look at the interface of QVariant.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mrbean-bremen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #97 on February 17, 2023 15:23.