04-02-2014 12:48 PM
I'm new to native development, still trying to get a hang of how things are done in QML. I was wondering how it was possible to format the header in ListView based on the header value. For example, the datamodel is sorted by Status and Name. Status is stored as an integer 0,1,2,3,4,5 in the database. Whenever the ListView displays the headers, I'd like to show the actual title of the Status (eg Pending, Completed) instead of showing 0 or 1.
Thank you for your help.
Solved! Go to Solution.
04-02-2014 01:16 PM
Not sure this is really a ListView question more like a C++ or QML question.
In C++ you can define an enum and then read the enum corresponding to the number returned.
In QML you could do a simple switch statement.
04-02-2014 01:32 PM