D27060: Introduce coding-conventions.md

David Edmundson noreply at phabricator.kde.org
Mon Feb 3 10:04:11 GMT 2020


davidedmundson accepted this revision.
davidedmundson added a comment.
This revision is now accepted and ready to land.


  ++
  
  You know my thoughts on per project rules. 
  But maybe it is different for kwin. Use of setRight() is the easier call than left+width() if you are actually using it for painting and need to think about the 1px the other way round.
  
  But would here work? https://community.kde.org/Policies/API_to_Avoid#API_that_is_considered_broken  
  if we added a line about "for anything other than painting"

INLINE COMMENTS

> coding-conventions.md:38
> +Exception 1: you can use `QRect::moveRight()` and `QRect::moveBottom()` to snap a rectangle to
> +another rectangle as long as the corresponding borders match, for example
> +

please say another QRect instead of rectangle.

QRectF source;
QRect target;

target.setRight(source.right());

is problematic

REPOSITORY
  R108 KWin

BRANCH
  coding-conventions

REVISION DETAIL
  https://phabricator.kde.org/D27060

To: zzag, #kwin, davidedmundson
Cc: davidedmundson, kwin, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20200203/0ea78602/attachment.html>


More information about the kwin mailing list