Followed this question. Got this answer:
Update: This is no longer necessary as of Qt 5. A currentData() method has been added
Havin