[Kde-games-devel] Review Request 127869: Fix warning "item has already been added to this scene"

Martin Walch walch.martin at web.de
Sun May 8 14:27:25 UTC 2016


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

Review request for KDE Games.


Repository: lskat


Description
-------

When starting the game, exactly 8 identical warnings appear:

> QGraphicsScene::addItem: item has already been added to this scene

Their origin lies in the ScoreSprite constructor which instantiates several QGraphicsTextItems, passing itself as parent. Afterwards each of them is explicitely added to the same scene as the ScoreSprite using scene->addItem. However, this is redundant because passing the ScoreSprite as parent already makes the new QGraphicsTextItems part of the same scene. Hence the warning.


Diffs
-----

  src/scoresprite.cpp 4d051da 

Diff: https://git.reviewboard.kde.org/r/127869/diff/


Testing
-------

Compiles fine.
Warnings do not appear any more at runtime.
Layout of UI looks unchanged.


Thanks,

Martin Walch

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20160508/daa5297f/attachment.html>


More information about the kde-games-devel mailing list