<table><tr><td style="">kossebau added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D6769" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>I considered adding the QWidget parent to the KDevelop::Context class, so just one argument is passed around as before in the actual context menu content query calls.<br />
Decided against as that meant to me mixing of concerns, for one the object describing read-only the context in which the menu is to appear, while the parent object is to be actively used for memory management of the elements added.<br />
So it felt more clean to have that as explicit separate arguments in the contextMenuExtension() method, instead of having invokers of the contextmenu collection stuffing this into the context description object and providers fetching it again out of that object.</p>

<p>Also went for QWidget as parent and not the QMenu object, even if in the current use-cases it is always the menu, because this way on the callee side it follows a usual parent type with widget classes, so common pattern, and it will avoid implementers being confused about what other things to do with the menu perhaps, when they should not and just use it for memory management purposes.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R33 KDevPlatform</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6769" rel="noreferrer">https://phabricator.kde.org/D6769</a></div></div><br /><div><strong>To: </strong>kossebau, KDevelop<br /><strong>Cc: </strong>kdevelop-devel<br /></div>