Work around problems in QTreeView when using Qt 4.8