27 #include <QFileIconProvider>
28 #include <QtAlgorithms>
47 val = QVariant (f.fileName ());
51 val = QVariant (f.absolutePath ());
62 left.toString ().compare (right.toString (), Qt::CaseInsensitive) < 0;
67 QVariant rightval =
getValue (right);
72 return !
lessThan (leftval, rightval);
104 beginInsertRows (QModelIndex (),
_files.size (),
_files.size () );
111 if (less_than (info, *it))
break;
138 if (role == Qt::DisplayRole)
140 switch (idx.column ())
143 retval = QVariant (
_files[idx.row ()].fileName ());
147 retval = QVariant (
_files[idx.row ()].absolutePath ());
154 else if (role == Qt:: DecorationRole)
156 switch (idx.column ())
173 if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
184 if (order == Qt::DescendingOrder)
213 QFileIconProvider icon_provider;
216 return icon_provider.icon (
_files[p.row ()]);