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

Chapter 4 & 5 code asserts when adding a picture #12

Closed
bigguiness opened this issue Jul 30, 2021 · 3 comments
Closed

Chapter 4 & 5 code asserts when adding a picture #12

bigguiness opened this issue Jul 30, 2021 · 3 comments

Comments

@bigguiness
Copy link

I tried going through Chapter 5 myself and kept getting an assert when adding a picture:

Query OK: "INSERT INTO pictures (album_id, url) VALUES (:album_id, :url)"
ASSERT: "proxyIndex.model() == this" in file itemmodels\qidentityproxymodel.cpp, line 259

I then found this repo so I tried the Chapter 5 code from the repo. Same result.

The debug call path shows that the last executed line in the code is:

void AlbumWidget::addPictures() {
    ...
        ui->thumbnailListView->setCurrentIndex(lastModelIndex);

The failing assert is in:

QModelIndex QIdentityProxyModel::mapToSource(const QModelIndex& proxyIndex)

Any ideas why?

@GuillaumeLazar
Copy link
Collaborator

It's remember me something. I guess we already fixed it on GitHub repository of the second edition. Can you check if this PR help you? PacktPublishing/Mastering-Qt-5-Second-Editon#1

@GuillaumeLazar GuillaumeLazar changed the title Chapter 4 code asserts when adding a picture Chapter 5 code asserts when adding a picture Jul 30, 2021
@GuillaumeLazar GuillaumeLazar changed the title Chapter 5 code asserts when adding a picture Chapter 4 & 5 code asserts when adding a picture Jul 30, 2021
@GuillaumeLazar
Copy link
Collaborator

I also applied the PR on this repository. You can check it here: bd85b91

@JosephA-packt
Copy link

I hope that you have got your answer
@bigguiness

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

No branches or pull requests

3 participants