Hello, guys. At first, sorry for my bad english...
For my purposes I was created widget kinda "date picker", based on model/view architecture. Widget haves the next structure (for example):
2000
January
1
2
3
...
February
1
2
3
...
Other months...
2001
January
1
...
2002
2003
...
etc
2000
January
1
2
3
...
February
1
2
3
...
Other months...
2001
January
1
...
2002
2003
...
etc
To copy to clipboard, switch view to plain text mode
User can pick a date. Not just a day, he can also pick a month, or a year.
It's so easy to get data of the selected item, just
value = model->data(treeWidget->currentIndex(), Qt::DisplayRole);
value = model->data(treeWidget->currentIndex(), Qt::DisplayRole);
To copy to clipboard, switch view to plain text mode
but how to get the parent of the selected item? In case when user selected a month or a day, we need to know, for which year belongs this month (or for which year and month belongs this day).
So, I need help How to get data of the parent of the selected item?
Bookmarks