|
@@ -584,6 +584,30 @@ QString ctkPathListWidget::path(int row) const
|
|
|
}
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
+QStandardItem* ctkPathListWidget::item(int row) const
|
|
|
+{
|
|
|
+ Q_D(const ctkPathListWidget);
|
|
|
+ return d->PathListModel.item(row);
|
|
|
+}
|
|
|
+
|
|
|
+// --------------------------------------------------------------------------
|
|
|
+QStandardItem *ctkPathListWidget::item(const QString &absolutePath) const
|
|
|
+{
|
|
|
+ Q_D(const ctkPathListWidget);
|
|
|
+ QModelIndexList result = d->PathListModel.match(d->PathListModel.index(0,0), AbsolutePathRole,
|
|
|
+ absolutePath, 1, Qt::MatchExactly);
|
|
|
+ Q_ASSERT(result.count() < 2);
|
|
|
+ if (result.isEmpty())
|
|
|
+ {
|
|
|
+ return NULL;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return d->PathListModel.item(result.front().row());
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// --------------------------------------------------------------------------
|
|
|
QString ctkPathListWidget::pathAt(const QPoint& point) const
|
|
|
{
|
|
|
Q_D(const ctkPathListWidget);
|
|
@@ -591,6 +615,18 @@ QString ctkPathListWidget::pathAt(const QPoint& point) const
|
|
|
}
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
+QStandardItem* ctkPathListWidget::itemAt(const QPoint &point) const
|
|
|
+{
|
|
|
+ Q_D(const ctkPathListWidget);
|
|
|
+ QModelIndex index = this->indexAt(point);
|
|
|
+ if (index.isValid())
|
|
|
+ {
|
|
|
+ return d->PathListModel.item(index.row());
|
|
|
+ }
|
|
|
+ return NULL;
|
|
|
+}
|
|
|
+
|
|
|
+// --------------------------------------------------------------------------
|
|
|
int ctkPathListWidget::row(const QString& path) const
|
|
|
{
|
|
|
Q_D(const ctkPathListWidget);
|