Details
- Reviewers
nienhueser rahn - Group Reviewers
Marble - Commits
- R34:a8e5b33e843a: Add basic OSM notes to marble
Diff Detail
- Repository
- R34 Marble
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Any chance you attached an incomplete patch? It compiles etc, but has some logic errors. Maybe it's just one commit of several?
src/plugins/render/notes/NotesModel.cpp | ||
---|---|---|
45 | The last append(",") results in an invalid URL. | |
74 | The id is not extracted here, guess it needs a toInt() and afterwards a conversion to QString. |
I still don't see any drawing. Placed a debug statement in NotesItem::paint(), but it never gets triggered. The notes online service is activated in the menu of course, and I see that it downloads and parses notes with ids successfully. Do you know what could go wrong there?
Strange. I'm not very experienced with QPainter, so I wouldn't be surprised if that was the issue. But if paint() is never called, that's impossible. I would think that the item wasn't created successfully, but it seems it is. I'll keep looking around; I'll check to see where the paint() is actually supposed to be called from - perhaps by looking some more in AbstractDataPlugin and PostalCodePlugin and the item classes.
It looks like paint() is called from MarbleGraphicsItem::paintEvent(). I'm placing some debug statements in their to try and see what happens.
There are three problems that prevent notes from showing up:
- the item size is initialized to (0, 0) and not updated later
- the image is loaded from a relative location where it cannot be found
- longitude and latitude are swapped in the parser, leading to wrong/invalid coordinates
See https://paste.kde.org/pdqyyb64q for a patch that fixes that. With that I finally have notes showing up on my system.
Thanks. I had a really wrong idea of what QSize did. Sorry about the trouble.
And ofc the image wouldn't load in the built application because the relative path from the source would no longer be valid (since the image wouldn't be installed directly beside the notes plugin), this one is a bit of a facepalm for me.
Off topic, the reason to use drawPixmap instead of drawImage is simply performance efficiency, right?