Compilation problem with d6200568056
Scott Kostyshak
skostysh at lyx.org
Sun Mar 2 14:22:04 UTC 2025
On Sat, Mar 01, 2025 at 11:48:52AM +0100, Scott Kostyshak wrote:
> On Thu, Feb 27, 2025 at 10:06:42PM +0100, Scott Kostyshak wrote:
> > On Thu, Feb 27, 2025 at 09:59:06PM +0900, Koji Yokota wrote:
> > > > 2025/02/27 17:57、Kornel Benko <kornel at lyx.org>のメール:
> > > >
> > > > after this commit, I get error compiling with clang-15 ang QT 6.2.4.
> > > >
> > > > Kornel
> > >
> > >
> > > Thank you, Kornel.
> > >
> > > The operator “+” to combine keys is replaced by “|” as of Qt 6.0.
> > >
> > > It is now fixed at 16d1133.
> >
> > The fix works for me for Qt 6 (specifically, 6.4.2). But I get a failure
> > with Qt 5.15.13 (with -Werror). Both variants fail for me.
> >
> > This is the initial failure:
> >
> > /home/scott/lyxbuilds/master-master/repo/src/frontends/qt/GuiPrefs.cpp:1047:46: error: arithmetic between different enumeration types ('Qt::Modifier' and 'Qt::Key') is deprecated [-Werror,-Wdeprecated-enum-enum-conversion]
> > 1047 | new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_L), this);
> > | ~~~~~~~~ ^ ~~~~~~~~~
> >
> > And if I change the condition to be < 5.15.0, then I get the following
> > failure:
> >
> > /home/scott/lyxbuilds/master-master/repo/src/frontends/qt/GuiPrefs.cpp:1050:46: error: bitwise operation between different enumeration types ('Qt::Modifier' and 'Qt::Key') is deprecated [-Werror,-Wdeprecated-enum-enum-conversion]
> > 1050 | new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_L), this);
> > | ~~~~~~~~ ^ ~~~~~~~~~
> >
> > Any idea?
>
> The following works for me:
>
> new QShortcut(QKeySequence(tr("Ctrl+l")), this);
>
> I took this form from here: https://doc.qt.io/qtforpython-5/PySide2/QtGui/QKeySequence.html
>
> I don't know how to test it though. How do I test this control sequence?
I figured out how to test it and committed the fix at f6197bdf.
Note that the Qt accelerator does not show, since this is hardcoded but
I'm guessing this is known.
Scott
-------------- 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/20250302/cd8caef8/attachment.sig>
More information about the lyx-devel
mailing list