PDA

View Full Version : [SOLVED] QSortFilterProxyModel crash



Guilo
22nd April 2010, 19:50
Hi !

I have a QLineEdit and a QListView. I use a QSortFilterProxyModel to filter my list. It works great. Then, I want to know which line is selected in my QLIstView. I use selectedindexex and QSortFilterProxyModel::data. But if I have not typed anything in the qlineedit it will give me a segfault. If I type something it works great. If I erase what I have typed it also works. In fact it only fails if nothing has never been typed in the LineEdit.

Any Idea ?

Thanks

wysota
22nd April 2010, 20:07
Can we see the code that causes the crash?

Guilo
22nd April 2010, 20:18
I have found my error when looknig for the code i should paste here. The pointer on the QSortFilterProxyModel was initialized in the slot where I do the filter. So When I had never typed anything it crashed... :rolleyes: