Review Request 127419: Fix build with -DQT_STRICT_ITERATORS

Andreas Cord-Landwehr cordlandwehr at kde.org
Fri Mar 18 20:26:49 UTC 2016



> On März 18, 2016, 6:34 nachm., Albert Astals Cid wrote:
> > kstars/auxiliary/qcustomplot.cpp, line 21439
> > <https://git.reviewboard.kde.org/r/127419/diff/1/?file=453564#file453564line21439>
> >
> >     Do we really need this? mData is a member variable and the function is const so the lowerBound called here should be the const variant, no?

I agree that this would be a logical conclusion :)
However, AFAIK since the QMap::lowerBound method is overloaded only by a const specifier, the decisions whether calling the const or the non-const method is based on the const'ness of the object. What I did here is IMO the easiest way to let a stack-object behave as it was a const object. -- Without doing this, lowerBound returns a non-const iterator.


- Andreas


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


On März 18, 2016, 7:44 vorm., Andreas Cord-Landwehr wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/127419/
> -----------------------------------------------------------
> 
> (Updated März 18, 2016, 7:44 vorm.)
> 
> 
> Review request for KDE Edu and KStars.
> 
> 
> Repository: kstars
> 
> 
> Description
> -------
> 
> Avoid silent and implicit constness casts.
> 
> 
> Diffs
> -----
> 
>   kstars/auxiliary/qcustomplot.cpp 8d178be 
> 
> Diff: https://git.reviewboard.kde.org/r/127419/diff/
> 
> 
> Testing
> -------
> 
> Compilation tested.
> 
> 
> Thanks,
> 
> Andreas Cord-Landwehr
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20160318/3a24df8d/attachment.html>


More information about the kde-edu mailing list