D15625: Sublime: Fix crash when changing areas

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Thu Sep 27 17:26:17 BST 2018


kossebau accepted this revision.
kossebau added a comment.


  Besides the two nitpicks,  happy with the result, good work. Works here as intended, across multiple styles I tested (also at runtime).
  
  So from my POV, time to land this in the 5.3 branch, the bug hopefully enjoyed its lifetime a bit, may it enjoy some reincarnation then somewhere else and ideally as feature :)

INLINE COMMENTS

> ideallayout.cpp:76
>  
> -int IdealButtonBarLayout::doHorizontalLayout(const QRect &rect, bool updateGeometry) const
> +bool IdealButtonBarLayout::eventFilter(QObject* watched, QEvent* event)
>  {

eventFilter reimplementation best also call the one of the base class, as one never knows if the base classes do not need to do some filtering as well. Might not be the case here currently, but let's be future-proof and base class co-operative by default :)

Usually done by doing in the final return statement, that also spares a variable to remember the result (also drops the need for Q_UNUSED()):

  return QBoxLayout::eventFilter(watched, event);

> ideallayout.h:36
>  public:
> -    explicit IdealButtonBarLayout(Qt::Orientation orientation, QWidget *parent = nullptr);
> +    IdealButtonBarLayout(Qt::Orientation orientation, QWidget *styleParent);
>  

Please move the * to the type, while you touch the line/argument :)

REPOSITORY
  R32 KDevelop

BRANCH
  segfault-fix

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

To: amhndu, #kdevelop, kossebau, rjvbb
Cc: kossebau, rjvbb, kdevelop-devel, glebaccon, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180927/4efa31ee/attachment.html>


More information about the KDevelop-devel mailing list