Hello.

I am creating an FtpFileSystemModel, and, for that, I am using QAbstractItemModel as a base, which I have never subclassed before.

After quite a few problems I have reached the point where my ftp files are displayed in a QTreeView, just like a QFileSystemModel would do with a local fs.

There are a few quirks here and there, though. The thing that worries me is that all the indexes (or "cells"), show a ticker next to them. This is better illustrated with a screenshot:

20140517.122325.jpg

See the ftp file listing to the middle-right portion of the screenshot.

Before you ask, the flags() method is this:

Qt Code:
  1. Qt::ItemFlags FtpFileSystemModel::flags(const QModelIndex &index) const
  2. {
  3. if(!index.isValid())
  4. {
  5. return 0;
  6. }
  7.  
  8. Qt::ItemFlags flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
  9. qDebug() << Q_FUNC_INFO << QString("flags: %1").arg(flags);
  10. return flags;
  11. }
To copy to clipboard, switch view to plain text mode 

As you see, neither of Qt::ItemIsUserCheckable or Qt::ItemIsTristate is set.

I have also a problem with alignment, but I haven't dug much into it. I am setting these in data(), but they don't seem to do anything:

Qt Code:
  1. if(role == Qt::TextAlignmentRole)
  2. {
  3. Qt::Alignment flags = 0;
  4.  
  5. if(index.column() == 0 || index.column() == 1)
  6. {
  7. flags = Qt::AlignVCenter | Qt::AlignLeft;
  8. }
  9. else
  10. {
  11. flags = Qt::AlignVCenter | Qt::AlignRight;
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

Thanks for any idea you can share