Hi, in the documentation at http://doc.qt.io/qt-4.8/qabstractitemmodel.html the following is told us:
> When subclassing QAbstractItemModel > <http://doc.qt.io/qt-4.8/qdeclarativemodels.html#qabstractitemmodel> or > QAbstractProxyModel > <http://doc.qt.io/qt-4.8/qabstractproxymodel.html>, ensure that you > emitlayoutAboutToBeChanged > <http://doc.qt.io/qt-4.8/qabstractitemmodel.html#layoutAboutToBeChanged>() > before changing the order of items or altering the structure of the > data you expose to views, and emit layoutChanged() after changing the > layout. Admittedly, PySide should not just crash, but I'm not sure if that is a PySide problem. It would be interesting to run the same example on PyQt and see how that behaves. cheers - Chris On 13.04.15 17:23, Paul O. Seidon wrote: > Strange, had to add the layoutToBeChanged signal in the timer callback: > > def _on_Qt_TIMEOUT_timer_( self): > self.layoutAboutToBeChanged.emit() > self.layoutChanged.emit() > return > > instead of just > > def _on_Qt_TIMEOUT_timer_( self): > self.layoutChanged.emit() > return > > Cheers > Paul > > > Paul O. Seidon wrote: > >> Dear PySiders, >> >> >> being a wxPython user for years I decided to have a look at Qt using >> PySide. A simple to-do manager containing to-dos that change their >> priority over time (depending on the distance of now to the due date) >> should be suited to get my feet wet. >> >> It uses QTableView, QSortFilterProxyModel and QAbstractTableModel. >> >> The QAbstractTableModel (actually the subclass) features a QTimer to >> recalculate the priorities of the to-dos. Here I do >> >> def _on_Qt_TIMEOUT_timer_( self): >> self.layoutChanged.emit() >> return >> >> to tell the view to redisplay the data. >> >> Everything works fine so far, but when I minimize, maximize, minimize, >> maximize, ... the GUI, then suddenly the app crashes upon maximizing the >> GUI. It does not so, if I don't start the QTimer. And, the smaller the >> timer interval the sooner it crashes. >> >> I guess there happens something in the QTableView when the GUI is max'ed >> that interferes with the slot called by self.layoutChanged.emit(). >> >> I'm on Arch Linux, Python 2.7.9. >> >> Any idea? >> >> >> Kind regards >> Paul > > _______________________________________________ > PySide mailing list > PySide@qt-project.org > http://lists.qt-project.org/mailman/listinfo/pyside -- Christian Tismer :^) tis...@stackless.com Software Consulting : http://www.stackless.com/ Karl-Liebknecht-Str. 121 : http://www.pydica.net/ 14482 Potsdam : GPG key -> 0xFB7BEE0E phone +49 173 24 18 776 fax +49 (30) 700143-0023
signature.asc
Description: OpenPGP digital signature
_______________________________________________ PySide mailing list PySide@qt-project.org http://lists.qt-project.org/mailman/listinfo/pyside