Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes when QML debugging is enabled #52

Open
timangus opened this issue May 11, 2018 · 2 comments
Open

Crashes when QML debugging is enabled #52

timangus opened this issue May 11, 2018 · 2 comments

Comments

@timangus
Copy link
Contributor

One thing I've noticed recently is that (presumably) changes in the QML debugger have started to cause crashes in qqsfpm. It seems that the debugger sometimes ends up (for whatever reason) in calling qqsfpm::data with an invalid index, which ultimately results in sourceModel() returning nullptr, and thus a nullptr de-reference. My fix is as follows, which is probably no bad thing anyway.

QVariant QQmlSortFilterProxyModel::data(const QModelIndex &index, int role) const
{
    if(!index.isValid())
        return {};

    return sourceData(mapToSource(index), role);
}
@oKcerG
Copy link
Owner

oKcerG commented May 11, 2018

Thanks, I'll look into that

@timangus
Copy link
Contributor Author

Or perhaps I should be using QAbstractItemModel::checkIndex()!

https://www.kdab.com/new-in-qt-5-11-improvements-to-the-model-view-apis-part-1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants