Saturday, March 28, 2009

Qt4 iPhone Like App Prefs

Here a simple example on How to Customize an ItemView class, in this case a QTreeView, to be similar to the iPhone Application Preferences Panel.

All the look'n' feel magic is provided by the ItemDelegate that paint the right object using the specified type.

There're six different item types: Button, Link, Group, Value, Multi-Value, Info. Values are all string except boolean that are painted as On/Off Button. Double Tap on this item to change is value. For all the others item when you click on it a right event will be dispatched, and you'll have to handle it to load the right "Edit" page.

This is Just an Example, to use in an application you need, at least, to differentiate the Display Role Value and the real KeyName value.

The Source Code is Available Here: Qt4 iPhone Like App Prefs Source Code.

2 comments:

  1. Fantastico! Impressive example :-)

    ReplyDelete
  2. hallo,

    best regards from germany. it´s look very nice, but a sample to managed a ItemModel i miss :o)

    thanks

    ReplyDelete