Hi,

I have a QTreeView that uses a subclassed QStandardItemModel model.
The treeview should keep an user list for a chat program.

What I want to do is to subclass QStandardItem in order to make user insertion/deletion/hiding easier but I'm not sure how should I reimplement the QStandardItem * QStandardItem::clone () const [virtual] method. I know that I need to do that in order to call void QStandardItemModel::setItemPrototype ( const QStandardItem * item ) in the model.

Here's what I was thinking the derived class should look like:

Qt Code:
  1. class MyQStandardItem : public QStandardItem {
  2. private:
  3. bool online;
  4. /* some other flags */
  5. public:
  6. /* default constructors and overloaded ones */
  7. bool isOnline () const { return online; }
  8. /* other functions */
  9. };
To copy to clipboard, switch view to plain text mode 

Considering I'm not using pointers as data members should I worry about clone () ?

I'm really confused on this one.
Thanks!