No, I derived QAbstractItemModel directly.

The only thing "strange" I'm doing is a trick somebody said me in this forum. I need to lock some columns and I've implemented a double QTreeView ( two QtreeView's, putted together side by side ), the left one with fixed size containing the locked columns and the right one containing scrollable data.

Both trees share the same model. I've connected signals between grids like this to maintain them in sync :

Qt Code:
  1. connect ( m_GridWidgetLock, SIGNAL ( expanded ( const QModelIndex & ) ), m_GridWidget, SLOT( expand ( const QModelIndex & ) ) );
  2. connect ( m_GridWidgetLock, SIGNAL ( collapsed ( const QModelIndex & ) ), m_GridWidget, SLOT ( collapse ( const QModelIndex & ) ) );
  3. connect ( m_GridWidget, SIGNAL ( expanded ( const QModelIndex & ) ), m_GridWidgetLock, SLOT ( expand ( const QModelIndex & ) ) );
  4. connect ( m_GridWidget, SIGNAL ( collapsed ( const QModelIndex & ) ), m_GridWidgetLock, SLOT ( collapse ( const QModelIndex & ) ) );
To copy to clipboard, switch view to plain text mode 

I've tested today a little bit and was my mistake. I was testing if m_GridWidget->isExpanded ( QModelIndex & index ) with column value = 0. Obviously, when I'm locking columns, I'm hiding the locked ones in right tree ( 0..L-1, where L is the number of locked columns )

And I was testing column 0, on THAT tree at the right side. Grrrrr. Wednesday is not a good day for debugging .

Thanks a lot Caduel, you pointed me in the right direction