Hi.
The topic was discussed couple of time on this forum, but not in the way that satisfies me.
My tree looks like
Qt Code:
  1. name DESC
  2. |-> ENTRY ID_100
  3. |-> ENTRY ID_101
  4. |-> ENTRY_2 ID_102
  5. |-> ENTRY_2 ID_103
To copy to clipboard, switch view to plain text mode 
It has 2 columns, first with name and second with ID (unique) what I want to do is to find index of ENTRY, when having only ID, and I really don't know how to do that.
I'm now trying to use the match() function but with no success. When I look for text in first column everything works great.
Code
Qt Code:
  1. QModelIndexList Items = model->match(
  2. model->index(0, 0),
  3. Qt::DisplayRole,
  4. QVariant::fromValue(QString("ENTRY_2")),
  5. -1,
  6. Qt::MatchRecursive);
To copy to clipboard, switch view to plain text mode 
returns me indexes of all entries with same text, but changing code to
Qt Code:
  1. QModelIndexList Items = model->match(
  2. model->index(0, 1),
  3. Qt::DisplayRole,
  4. QVariant::fromValue(102),
  5. -1,
  6. Qt::MatchRecursive);
To copy to clipboard, switch view to plain text mode 
results in empty list of indexes.
Is there a simple way to find index of "ENTRY" by finding the ID?