D26448: Add KRecentFilesMenu to replace KRecentFileAction

David Faure noreply at phabricator.kde.org
Thu Aug 13 10:58:24 BST 2020


dfaure added inline comments.

INLINE COMMENTS

> krecentfilesmenu.cpp:74
> +    {
> +        action = new QAction(titleWithSensibleWidth(qobject_cast<QWidget *>(menu->parent())));
> +        QObject::connect(action, &QAction::triggered, action, [this, menu]() {

QMenu is a QWidget. Why not just pass `menu` as argument?
It would use the menu's font which is more correct than the parent widget's font (the menu font could be set by a stylesheet or by `QApplication::setFont(font, "QMenu")`.

Also `menu` is never null, which simplifies the code in the method being called.

BRANCH
  recentfilemenu

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

To: nicolasfella, #frameworks, dfaure
Cc: broulik, elvisangelaccio, cfeck, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200813/7792cb93/attachment.htm>


More information about the Kde-frameworks-devel mailing list