Commit 20ec978b authored by hjk's avatar hjk Committed by hjk

TreeModel: Initialize root item with proper type in LeveledTreeModel

Current usage is to use setRootItem() manually when needed, but
since the type is known in a LeveledTreeModel this can be automatic.

Change-Id: I511acdf9b9b3f4b67cf87d07b5446baa329a6a77
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 5f4284e6
......@@ -250,7 +250,7 @@ template <class RootItem,
class LeveledTreeModel : public TreeModel
{
public:
explicit LeveledTreeModel(QObject *parent = 0) : TreeModel(parent) {}
explicit LeveledTreeModel(QObject *parent = 0) : TreeModel(new RootItem, parent) {}
explicit LeveledTreeModel(RootItem *root, QObject *parent = 0) : TreeModel(root, parent) {}
template <class Predicate>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment