Currently working on a patch to address deprecations that trigger -Werror with Qt 5.14.1

Scott Kostyshak skostysh at lyx.org
Tue Mar 3 19:24:39 UTC 2020


On Fri, Feb 28, 2020 at 02:35:18PM -0500, Scott Kostyshak wrote:
> Compiling LyX with Qt 5.14.1 gives deprecation warnings, which breaks
> compilation of LyX with -Werror. I'm working on a patch to address
> these. I'm sending this message just to avoid duplication of effort in
> case anyone else comes across these warnings. I'll hopefully finish the
> patch next week.

Attached is a patch that fixes a few warnings. There is one part of the
patch that I don't understand. Fixing these warnings was mechanical so I
don't think I need to understand it, but I'm still curious in case
anyone happens to know. The question is regarding the change below:

                // show all hidden items
                QTreeWidgetItemIterator it(shortcutsTW, QTreeWidgetItemIterator::Hidden);
                for (; *it; ++it)
-                       shortcutsTW->setItemHidden(*it, isAlwaysHidden(**it));
+                       (*it)->setHidden(isAlwaysHidden(**it));
                // close all categories
                for (int i = 0; i < shortcutsTW->topLevelItemCount(); ++i)
                        shortcutsTW->collapseItem(shortcutsTW->topLevelItem(i));

"it" is a QTreeWidgetItemIterator. "*it" is a QTreeWidgetItem. I don't
understand what "**it" is, or how it works. Does this mean that somehow
a QTreeWidgetItem::operator* is defined or something like that? 

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-a-few-deprecation-warnings-in-Qt-5.14.1.patch
Type: text/x-diff
Size: 4594 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200303/c40da309/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20200303/c40da309/attachment.asc>


More information about the lyx-devel mailing list