Compilation problem with d6200568056

Scott Kostyshak skostysh at lyx.org
Sat Mar 1 10:48:52 UTC 2025


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?

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/20250301/360f2ac4/attachment.sig>


More information about the lyx-devel mailing list