> On Aug. 2, 2016, 2:24 p.m., David Faure wrote:
> > I'll write a corresponding unittest. Why was the source index invalid? 
> > rowCount==0 in the source model?

Yes, the source model was empty.


- Daniel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/128575/#review97996
-----------------------------------------------------------


On Aug. 2, 2016, 2:14 p.m., Daniel Vrátil wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/128575/
> -----------------------------------------------------------
> 
> (Updated Aug. 2, 2016, 2:14 p.m.)
> 
> 
> Review request for KDE Frameworks and David Faure.
> 
> 
> Repository: kitemmodels
> 
> 
> Description
> -------
> 
> When Qt is built in debug mode, QAbstractItemModel::setModel() will invoke a 
> Q_ASSERT that unconditionally queries index of the first row of the model:
> 
>     Q_ASSERT_X(d->model->index(0,0) == d->model->index(0,0),
>                "QAbstractItemView::setModel",
>                "A model should return the exact same index "
>                "(including its internal id/pointer) when asked for it twice 
> in a row.");
> 
> This breaks the assumption in the KRearrangeColumnsProxyModel::index() that 
> when queried for a valid index, the source model must be able to provide a 
> valid index as well.
> 
> This patch simply removes the Q_ASSERT from 
> KRearrangeColumnsProxyModel::index() and instead returns an invalid 
> QModelIndex, as expected.
> 
> 
> Diffs
> -----
> 
>   src/krearrangecolumnsproxymodel.cpp 72e4f14 
> 
> Diff: https://git.reviewboard.kde.org/r/128575/diff/
> 
> 
> Testing
> -------
> 
> Triggered by Kleopatra on start, no more assert with this patch.
> 
> 
> Thanks,
> 
> Daniel Vrátil
> 
>

_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to