Don't know whether this is your problem or not, but variant.convert() returns a bool. In this case it will always be true (checked in the preceding "if" statement). Try using variant.toInt()Qt Code:
To copy to clipboard, switch view to plain text mode
Bookmarks