Re: [LyX/master] Allow compiling with Qt6

2021-03-21 Thread Enrico Forestieri
On Sun, Mar 21, 2021 at 09:53:45AM +0100, Jürgen Spitzmüller wrote:
> Am Samstag, dem 20.03.2021 um 19:19 +0100 schrieb Enrico Forestieri:
> > Does the attached patch work?
> 
> Yes, this works. Thanks!

Committed.

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-21 Thread Jürgen Spitzmüller
Am Samstag, dem 20.03.2021 um 19:19 +0100 schrieb Enrico Forestieri:
> Does the attached patch work?

Yes, this works. Thanks!

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-20 Thread Enrico Forestieri
On Sat, Mar 20, 2021 at 02:50:26PM +0100, Jürgen Spitzmüller wrote:
> 
> On OpenSuse (Tumbleweed), Qt6 qmake is called "qmake6", moc "moc6" (not
> "moc-qt6").
> 
> Can we account for this configuration, too?

Does the attached patch work?

-- 
Enrico
diff --git a/config/qt.m4 b/config/qt.m4
index 4b1bfc4068..abefab8512 100644
--- a/config/qt.m4
+++ b/config/qt.m4
@@ -73,10 +73,13 @@ AC_DEFUN([QT_FIND_TOOL],
 [
$1=
qt_ext=qt4
+   qt_maj=4
if test "x$USE_QT6" != "xno" ; then
qt_ext=qt6
+   qt_maj=6
elif test "x$USE_QT5" != "xno" ; then
qt_ext=qt5
+   qt_maj=5
fi
 
if test -n "$qt_cv_bin" ; then
@@ -91,7 +94,7 @@ AC_DEFUN([QT_FIND_TOOL],
fi
fi
if test -z "$$1"; then
-   AC_CHECK_PROGS($1, [$2-$qt_ext $2],[],$PATH)
+   AC_CHECK_PROGS($1, [$2-$qt_ext $2$qt_maj $2],[],$PATH)
fi
if test -z "$$1"; then
AC_MSG_ERROR([cannot find $2 binary.])
@@ -401,7 +404,16 @@ AC_DEFUN([QT6_QMAKE_CONFIG],
AC_MSG_CHECKING([for Qt6])
dnl Use first qmake in PATH
ver=`qmake -v | grep -o "Qt version ."`
+   qmake6=""
if test "$ver" = "Qt version 6"; then
+   qmake6="qmake"
+   else
+   ver=`qmake6 -v | grep -o "Qt version ."`
+   if test "$ver" = "Qt version 6"; then
+   qmake6="qmake6"
+   fi
+   fi
+   if test -n "$qmake6" ; then
dnl Use a .pro file for getting qmake's variables
lyx_test_qt_dir=`mktemp -d`
lyx_test_qt_pro="$lyx_test_qt_dir/test.pro"
@@ -413,12 +425,12 @@ percent.target = %
 percent.commands = @echo -n "\$(\$(@))\ "
 QMAKE_EXTRA_TARGETS += percent
 EOF1
-   qmake $lyx_test_qt_pro -o $lyx_test_qt_mak 1>/dev/null 2>&1
+   $qmake6 $lyx_test_qt_pro -o $lyx_test_qt_mak 1>/dev/null 2>&1
QT_CORE_INCLUDES=`cd $lyx_test_qt_dir; make -s -f $lyx_test_qt_mak 
INCPATH | sed 's/-I\. //g'`
qt_corelibs=`cd $lyx_test_qt_dir; make -s -f $lyx_test_qt_mak LIBS`
QT_CORE_LDFLAGS=`echo $qt_corelibs | tr ' ' '\n' | grep -e "^-L" | 
tr '\n' ' '`
if test -z "$QT_CORE_LDFLAGS"; then
-   QT_CORE_LDFLAGS="-L`qmake -query QT_INSTALL_LIBS`"
+   QT_CORE_LDFLAGS="-L`$qmake6 -query QT_INSTALL_LIBS`"
QT_CORE_LIB="$qt_corelibs"
else
QT_CORE_LIB=`echo $qt_corelibs | tr ' ' '\n' | grep -e "^-l" | 
tr '\n' ' '`
@@ -440,17 +452,17 @@ percent.target = %
 percent.commands = @echo -n "\$(\$(@))\ "
 QMAKE_EXTRA_TARGETS += percent
 EOF2
-   qmake $lyx_test_qt_pro -o $lyx_test_qt_mak 1>/dev/null 2>&1
+   $qmake6 $lyx_test_qt_pro -o $lyx_test_qt_mak 1>/dev/null 2>&1
QT_INCLUDES=`cd $lyx_test_qt_dir; make -s -f $lyx_test_qt_mak 
INCPATH | sed 's/-I\. //g'`
qt_guilibs=`cd $lyx_test_qt_dir; make -s -f $lyx_test_qt_mak 
LIBS`
QT_LDFLAGS=`echo $qt_guilibs | tr ' ' '\n' | grep -e "^-L" | tr 
'\n' ' '`
if test -z "$QT_LDFLAGS"; then
-   QT_LDFLAGS="-L`qmake -query QT_INSTALL_LIBS`"
+   QT_LDFLAGS="-L`$qmake6 -query QT_INSTALL_LIBS`"
QT_LIB="$qt_guilibs"
else
QT_LIB=`echo $qt_guilibs | tr ' ' '\n' | grep -e "^-l" | tr 
'\n' ' '`
fi
-   QTLIB_VERSION=`qmake -v | grep "Qt version" | sed -e 
's/.*\([[0-9]]\.[[0-9]]*\.[[0-9]]\).*/\1/'`
+   QTLIB_VERSION=`$qmake6 -v | grep "Qt version" | sed -e 
's/.*\([[0-9]]\.[[0-9]]*\.[[0-9]]\).*/\1/'`
if test -z "$QT_LIB"; then
AC_MSG_RESULT(no)
else
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-20 Thread Jürgen Spitzmüller
Am Montag, dem 15.03.2021 um 17:33 +0100 schrieb Enrico Forestieri:
> commit 635a7d77ddc94c63d52494dc4d68a930faccf45f
> Author: Enrico Forestieri 
> Date:   Mon Mar 15 17:09:09 2021 +0100
> 
>     Allow compiling with Qt6
>     
>     This commit allows compiling LyX with Qt6 when using autotools.
>     For a successful compilation the following 2 conditions must be
> met.
>     
>     1) The Qt6 qmake has to come first in PATH, so that the command
>    "qmake -v | grep -o 'Qt version .'" returns "Qt version 6".
>     2) The --enable-qt6 switch has to be passed to the configure
> command.

On OpenSuse (Tumbleweed), Qt6 qmake is called "qmake6", moc "moc6" (not
"moc-qt6").

Can we account for this configuration, too?

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-18 Thread Kornel Benko
Am Tue, 16 Mar 2021 22:51:12 +0100
schrieb Yu Jin :

> >> Oh wait, that was my fault, chosen wrong folder  now it configures ok, 
> >> will try
> >> to compile..
> >  
> Visual Studio gave a lot of errors, I attached a csv file containing those.
> --
>     Eugene
> 

These are many errors from many sources. Sorry, I cannot help, no windows os 
here.

Kornel


pgpqtOcLYy_PF.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Scott Kostyshak
On Tue, Mar 16, 2021 at 03:05:07PM -0400, Scott Kostyshak wrote:

> Thanks, I'll try to take a look at this tonight.

Indeed I was missing some dependencies. I reinstalled and compilation
succeeded. Log attached in case anyone is interested in looking at the
warnings.

Scott
lyxbuild: building with 1 core(s)
make  all-recursive
make[1]: Entering directory '/home/vbox/lyxbuilds/qttest/repo'
Making all in autotests
make[2]: Entering directory '/home/vbox/lyxbuilds/qttest/repo/autotests'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/autotests'
Making all in config
make[2]: Entering directory '/home/vbox/lyxbuilds/qttest/repo/config'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/config'
Making all in development
make[2]: Entering directory '/home/vbox/lyxbuilds/qttest/repo/development'
make[3]: Entering directory '/home/vbox/lyxbuilds/qttest/repo/development'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/development'
make[2]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/development'
Making all in po
make[2]: Entering directory '/home/vbox/lyxbuilds/qttest/repo/po'
make lyx.pot-update
make[3]: Entering directory '/home/vbox/lyxbuilds/qttest/repo/po'
sed -e '/^#/d' remove-potcdate.sin > t-remove-potcdate.sed
mv t-remove-potcdate.sed remove-potcdate.sed
LC_ALL=C ; export LC_ALL ; /usr/bin/python3 ./lyx_pot.py -b .. -o qt_l10n.pot 
-t qt ../src/frontends/qt/ui/AboutUi.ui ../src/frontends/qt/ui/BibitemUi.ui 
../src/frontends/qt/ui/BiblioUi.ui ../src/frontends/qt/ui/BibtexUi.ui 
../src/frontends/qt/ui/BoxUi.ui ../src/frontends/qt/ui/BranchesUi.ui 
../src/frontends/qt/ui/BranchesUnknownUi.ui ../src/frontends/qt/ui/BranchUi.ui 
../src/frontends/qt/ui/BulletsUi.ui ../src/frontends/qt/ui/ChangesUi.ui 
../src/frontends/qt/ui/ChangeTrackingUi.ui 
../src/frontends/qt/ui/CharacterUi.ui ../src/frontends/qt/ui/CitationUi.ui 
../src/frontends/qt/ui/ColorUi.ui ../src/frontends/qt/ui/CompareHistoryUi.ui 
../src/frontends/qt/ui/CompareUi.ui ../src/frontends/qt/ui/CounterUi.ui 
../src/frontends/qt/ui/DelimiterUi.ui ../src/frontends/qt/ui/DocumentUi.ui 
../src/frontends/qt/ui/ErrorListUi.ui ../src/frontends/qt/ui/ERTUi.ui 
../src/frontends/qt/ui/ExternalUi.ui ../src/frontends/qt/ui/FindAndReplaceUi.ui 
../src/frontends/qt/ui/FloatPlacementUi.ui ../src/frontends/qt/ui/FontUi.ui 
../src/frontends/qt/ui/GraphicsUi.ui ../src/frontends/qt/ui/HSpaceUi.ui 
../src/frontends/qt/ui/HyperlinkUi.ui ../src/frontends/qt/ui/IncludeUi.ui 
../src/frontends/qt/ui/IndexUi.ui ../src/frontends/qt/ui/IndicesUi.ui 
../src/frontends/qt/ui/InfoUi.ui ../src/frontends/qt/ui/InsetParamsUi.ui 
../src/frontends/qt/ui/LabelUi.ui ../src/frontends/qt/ui/LanguageUi.ui 
../src/frontends/qt/ui/LaTeXUi.ui ../src/frontends/qt/ui/LineUi.ui 
../src/frontends/qt/ui/ListingsSettingsUi.ui 
../src/frontends/qt/ui/ListingsUi.ui ../src/frontends/qt/ui/LocalLayoutUi.ui 
../src/frontends/qt/ui/LogUi.ui ../src/frontends/qt/ui/LyXFilesUi.ui 
../src/frontends/qt/ui/MarginsUi.ui ../src/frontends/qt/ui/MasterChildUi.ui 
../src/frontends/qt/ui/MathMatrixUi.ui ../src/frontends/qt/ui/MathsUi.ui 
../src/frontends/qt/ui/ModulesUi.ui ../src/frontends/qt/ui/NomenclUi.ui 
../src/frontends/qt/ui/NoteUi.ui ../src/frontends/qt/ui/NumberingUi.ui 
../src/frontends/qt/ui/OutputUi.ui ../src/frontends/qt/ui/PageLayoutUi.ui 
../src/frontends/qt/ui/ParagraphUi.ui ../src/frontends/qt/ui/PDFSupportUi.ui 
../src/frontends/qt/ui/PhantomUi.ui ../src/frontends/qt/ui/PreambleUi.ui 
../src/frontends/qt/ui/PrefColorsUi.ui 
../src/frontends/qt/ui/PrefCompletionUi.ui 
../src/frontends/qt/ui/PrefConvertersUi.ui 
../src/frontends/qt/ui/PrefDisplayUi.ui 
../src/frontends/qt/ui/PrefDocHandlingUi.ui 
../src/frontends/qt/ui/PrefEditUi.ui 
../src/frontends/qt/ui/PrefFileformatsUi.ui 
../src/frontends/qt/ui/PrefIdentityUi.ui ../src/frontends/qt/ui/PrefInputUi.ui 
../src/frontends/qt/ui/PrefLanguageUi.ui ../src/frontends/qt/ui/PrefLatexUi.ui 
../src/frontends/qt/ui/PrefOutputUi.ui ../src/frontends/qt/ui/PrefPathsUi.ui 
../src/frontends/qt/ui/PrefScreenFontsUi.ui 
../src/frontends/qt/ui/PrefShortcutsUi.ui 
../src/frontends/qt/ui/PrefSpellcheckerUi.ui ../src/frontends/qt/ui/PrefsUi.ui 
../src/frontends/qt/ui/PrefUi.ui ../src/frontends/qt/ui/PrintindexUi.ui 
../src/frontends/qt/ui/PrintNomenclUi.ui 
../src/frontends/qt/ui/ProgressViewUi.ui ../src/frontends/qt/ui/RefUi.ui 
../src/frontends/qt/ui/SearchUi.ui ../src/frontends/qt/ui/SendtoUi.ui 
../src/frontends/qt/ui/ShortcutUi.ui ../src/frontends/qt/ui/ShowFileUi.ui 
../src/frontends/qt/ui/SpellcheckerUi.ui ../src/frontends/qt/ui/SymbolsUi.ui 
../src/frontends/qt/ui/TabularCreateUi.ui ../src/frontends/qt/ui/TabularUi.ui 
../src/frontends/qt/ui/TexinfoUi.ui ../src/frontends/qt/ui/TextLayoutUi.ui 
../src/frontends/qt/ui/ThesaurusUi.ui ../src/frontends/qt/ui/TocUi.ui 
../src/frontends/qt/ui/ToggleWarningUi.ui 

Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Yu Jin
Am Di., 16. März 2021 um 22:33 Uhr schrieb Yu Jin :

> Am Di., 16. März 2021 um 22:30 Uhr schrieb Yu Jin :
>
>> Am Di., 16. März 2021 um 19:04 Uhr schrieb Kornel Benko :
>>
>>> Am Tue, 16 Mar 2021 18:21:19 +0100
>>> schrieb Yu Jin :
>>>
>>> > Am Di., 16. März 2021 um 16:36 Uhr schrieb Kornel Benko <
>>> kor...@lyx.org>:
>>> >
>>> > > Am Tue, 16 Mar 2021 16:32:49 +0100
>>> > > schrieb Yu Jin :
>>> > >
>>> > > > Just seen this one and wanted to try it out obviously :)
>>> > > > But it doesn't work for me on Windows. Using CMake GUI I notice
>>> that the
>>> > > > dropdown menu LYX_USE_QT does not contain QT6, just QT5, QT4 and
>>> AUTO as
>>> > > > before. When I choose AUTO it fails with:
>>> > > >
>>> > > > CMake Error at development/cmake/modules/FindQt4.cmake:568
>>> (message):
>>> > > >   Could NOT find QtCore.  Check
>>> > > >   C:/lyx/masterbuild64Qt6/CMakeFiles/CMakeError.log for more
>>> details.
>>> > > > Call Stack (most recent call first):
>>> > > >   CMakeLists.txt:804 (find_package)
>>> > > >
>>> > > > It does find some QT6 stuff correctly though, like QT_PLUGINS_DIR,
>>> but
>>> > > not
>>> > > > everything, like QtCore.
>>> > >
>>> > > I have a patch ready, but cannot test.
>>> > >
>>> >
>>> > Care to share it? I can test.
>>>
>>> Attached.
>>>
>>
>> Still seems to be missing something. When I try to configure the same way
>> as with Qt5 (navigate to the Qt dir at CMAKE_PREFIX_PATH), it fails with
>> this error:
>>
>> CMake Error at CMakeLists.txt:786 (find_package):
>>   Could not find a package configuration file provided by "Qt6Core" with
>> any
>>   of the following names:
>>
>> Qt6CoreConfig.cmake
>> qt6core-config.cmake
>>
>>   Add the installation prefix of "Qt6Core" to CMAKE_PREFIX_PATH or set
>>   "Qt6Core_DIR" to a directory containing one of the above files.  If
>>   "Qt6Core" provides a separate development package or SDK, be sure it has
>>   been installed.
>>
>> Then I choose Qt6Core_DIR manually and then it fails again with basically
>> the same error but this time it's Qt6CoreToolsConfig.cmake. Also setting
>> that one manually fails with Qt6WidgetsConfig.cmake, (did not try past that
>> one).
>>
>> Oh wait, that was my fault, chosen wrong folder  now it configures
> ok, will try to compile..
>

Visual Studio gave a lot of errors, I attached a csv file containing those.
-- 
Eugene


Errors.csv
Description: MS-Excel spreadsheet
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Yu Jin
Am Di., 16. März 2021 um 22:30 Uhr schrieb Yu Jin :

> Am Di., 16. März 2021 um 19:04 Uhr schrieb Kornel Benko :
>
>> Am Tue, 16 Mar 2021 18:21:19 +0100
>> schrieb Yu Jin :
>>
>> > Am Di., 16. März 2021 um 16:36 Uhr schrieb Kornel Benko > >:
>> >
>> > > Am Tue, 16 Mar 2021 16:32:49 +0100
>> > > schrieb Yu Jin :
>> > >
>> > > > Just seen this one and wanted to try it out obviously :)
>> > > > But it doesn't work for me on Windows. Using CMake GUI I notice
>> that the
>> > > > dropdown menu LYX_USE_QT does not contain QT6, just QT5, QT4 and
>> AUTO as
>> > > > before. When I choose AUTO it fails with:
>> > > >
>> > > > CMake Error at development/cmake/modules/FindQt4.cmake:568
>> (message):
>> > > >   Could NOT find QtCore.  Check
>> > > >   C:/lyx/masterbuild64Qt6/CMakeFiles/CMakeError.log for more
>> details.
>> > > > Call Stack (most recent call first):
>> > > >   CMakeLists.txt:804 (find_package)
>> > > >
>> > > > It does find some QT6 stuff correctly though, like QT_PLUGINS_DIR,
>> but
>> > > not
>> > > > everything, like QtCore.
>> > >
>> > > I have a patch ready, but cannot test.
>> > >
>> >
>> > Care to share it? I can test.
>>
>> Attached.
>>
>
> Still seems to be missing something. When I try to configure the same way
> as with Qt5 (navigate to the Qt dir at CMAKE_PREFIX_PATH), it fails with
> this error:
>
> CMake Error at CMakeLists.txt:786 (find_package):
>   Could not find a package configuration file provided by "Qt6Core" with
> any
>   of the following names:
>
> Qt6CoreConfig.cmake
> qt6core-config.cmake
>
>   Add the installation prefix of "Qt6Core" to CMAKE_PREFIX_PATH or set
>   "Qt6Core_DIR" to a directory containing one of the above files.  If
>   "Qt6Core" provides a separate development package or SDK, be sure it has
>   been installed.
>
> Then I choose Qt6Core_DIR manually and then it fails again with basically
> the same error but this time it's Qt6CoreToolsConfig.cmake. Also setting
> that one manually fails with Qt6WidgetsConfig.cmake, (did not try past that
> one).
>
> Oh wait, that was my fault, chosen wrong folder  now it configures ok,
will try to compile..
-- 
Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Yu Jin
Am Di., 16. März 2021 um 19:04 Uhr schrieb Kornel Benko :

> Am Tue, 16 Mar 2021 18:21:19 +0100
> schrieb Yu Jin :
>
> > Am Di., 16. März 2021 um 16:36 Uhr schrieb Kornel Benko  >:
> >
> > > Am Tue, 16 Mar 2021 16:32:49 +0100
> > > schrieb Yu Jin :
> > >
> > > > Just seen this one and wanted to try it out obviously :)
> > > > But it doesn't work for me on Windows. Using CMake GUI I notice that
> the
> > > > dropdown menu LYX_USE_QT does not contain QT6, just QT5, QT4 and
> AUTO as
> > > > before. When I choose AUTO it fails with:
> > > >
> > > > CMake Error at development/cmake/modules/FindQt4.cmake:568 (message):
> > > >   Could NOT find QtCore.  Check
> > > >   C:/lyx/masterbuild64Qt6/CMakeFiles/CMakeError.log for more details.
> > > > Call Stack (most recent call first):
> > > >   CMakeLists.txt:804 (find_package)
> > > >
> > > > It does find some QT6 stuff correctly though, like QT_PLUGINS_DIR,
> but
> > > not
> > > > everything, like QtCore.
> > >
> > > I have a patch ready, but cannot test.
> > >
> >
> > Care to share it? I can test.
>
> Attached.
>

Still seems to be missing something. When I try to configure the same way
as with Qt5 (navigate to the Qt dir at CMAKE_PREFIX_PATH), it fails with
this error:

CMake Error at CMakeLists.txt:786 (find_package):
  Could not find a package configuration file provided by "Qt6Core" with any
  of the following names:

Qt6CoreConfig.cmake
qt6core-config.cmake

  Add the installation prefix of "Qt6Core" to CMAKE_PREFIX_PATH or set
  "Qt6Core_DIR" to a directory containing one of the above files.  If
  "Qt6Core" provides a separate development package or SDK, be sure it has
  been installed.

Then I choose Qt6Core_DIR manually and then it fails again with basically
the same error but this time it's Qt6CoreToolsConfig.cmake. Also setting
that one manually fails with Qt6WidgetsConfig.cmake, (did not try past that
one).
-- 
Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Scott Kostyshak
On Tue, Mar 16, 2021 at 07:11:13PM +0100, Enrico Forestieri wrote:
> On Tue, Mar 16, 2021 at 01:48:43PM -0400, Scott Kostyshak wrote:
> > On Tue, Mar 16, 2021 at 10:44:13AM +0100, Enrico Forestieri wrote:
> > > On Mon, Mar 15, 2021 at 10:52:19PM -0400, Scott Kostyshak wrote:
> > > > 
> > > > Are there still QRegExp that need to be changed? I got an error from
> > > > src/support/qstring_helpers.cpp.
> > > 
> > > I actually don't know. Let me explain. There should be a compatibility
> > > layer for using Qt5 constructs, so I didn't search for all occurrences
> > > of QRegExp's but only changed the places where I was getting compiling
> > > errors. The code in qstring_helpers.cpp compiled without issues for me
> > > on both Linux and Windows, and thus I did not touch it.
> > 
> > I see. I think I might be missing the compatibility layer module. When
> > installing Qt, I just chose the default Qt 6.0.2 but perhaps I need to
> > customize the installation to include the Qt5 compatibility module.
> > 
> > > What kind of error are you getting?
> > 
> >   CXX  qstring_helpers.o
> > qstring_helpers.cpp:21:10: fatal error: QRegExp: No such file or directory
> >21 | #include 
> >   |  ^
> > compilation terminated.
> > make[5]: *** [Makefile:985: qstring_helpers.o] Error 1
> > make[5]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src/support'
> > make[4]: *** [Makefile:831: all] Error 2
> > make[4]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src/support'
> > make[3]: *** [Makefile:2588: all-recursive] Error 1
> > make[3]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src'
> > make[2]: *** [Makefile:1685: all] Error 2
> > make[2]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src'
> > make[1]: *** [Makefile:578: all-recursive] Error 1
> > make[1]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo'
> > make: *** [Makefile:473: all] Error 2
> 
> Please, save the attached file and then issue the following commands
> (replace qmake-qt6 with the path to the Qt6 qmake):
> 
> qmake-qt6 test.pro -o Makefile
> make -s -f Makefile INCPATH
> 
> Does the output include a path with QtCore5Compat in it? If not, then
> you are missing the qt5compat module.
> 
> For compiling LyX the necessary modules are qtbase, qtsvg, and qt5compat.

Thanks, I'll try to take a look at this tonight.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Jean-Marc Lasgouttes

Le 16/03/2021 à 18:39, Jürgen Spitzmüller a écrit :

Am Dienstag, dem 16.03.2021 um 15:30 +0100 schrieb Jean-Marc
Lasgouttes:

Needed, I do not know. I think it still works with Qt4.5 and we had
one user at some time, but nobody knows whether it still compiles. In
any case, it would be easy to fix if we got a report of broken LyX
with 4.5 IMO.


IIRC master has some functions that were introduced in 4.7.


I am OK with restricting to Qt 4.8. In this case, we could maybe get rid 
of the code that is only relevant to older versions.


JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Enrico Forestieri
On Tue, Mar 16, 2021 at 07:04:06PM +0100, Kornel Benko wrote:
> 
> Attached.

Please, note that Qt6 does not include Qt6X11Extras, Qt6WinExtras, and
Qt6MacExtras, while Qt6Core5Compat (or whatever it is called) is necessary.

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Enrico Forestieri
On Tue, Mar 16, 2021 at 01:48:43PM -0400, Scott Kostyshak wrote:
> On Tue, Mar 16, 2021 at 10:44:13AM +0100, Enrico Forestieri wrote:
> > On Mon, Mar 15, 2021 at 10:52:19PM -0400, Scott Kostyshak wrote:
> > > 
> > > Are there still QRegExp that need to be changed? I got an error from
> > > src/support/qstring_helpers.cpp.
> > 
> > I actually don't know. Let me explain. There should be a compatibility
> > layer for using Qt5 constructs, so I didn't search for all occurrences
> > of QRegExp's but only changed the places where I was getting compiling
> > errors. The code in qstring_helpers.cpp compiled without issues for me
> > on both Linux and Windows, and thus I did not touch it.
> 
> I see. I think I might be missing the compatibility layer module. When
> installing Qt, I just chose the default Qt 6.0.2 but perhaps I need to
> customize the installation to include the Qt5 compatibility module.
> 
> > What kind of error are you getting?
> 
>   CXX  qstring_helpers.o
> qstring_helpers.cpp:21:10: fatal error: QRegExp: No such file or directory
>21 | #include 
>   |  ^
> compilation terminated.
> make[5]: *** [Makefile:985: qstring_helpers.o] Error 1
> make[5]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src/support'
> make[4]: *** [Makefile:831: all] Error 2
> make[4]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src/support'
> make[3]: *** [Makefile:2588: all-recursive] Error 1
> make[3]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src'
> make[2]: *** [Makefile:1685: all] Error 2
> make[2]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src'
> make[1]: *** [Makefile:578: all-recursive] Error 1
> make[1]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo'
> make: *** [Makefile:473: all] Error 2

Please, save the attached file and then issue the following commands
(replace qmake-qt6 with the path to the Qt6 qmake):

qmake-qt6 test.pro -o Makefile
make -s -f Makefile INCPATH

Does the output include a path with QtCore5Compat in it? If not, then
you are missing the qt5compat module.

For compiling LyX the necessary modules are qtbase, qtsvg, and qt5compat.

-- 
Enrico
qtHaveModule(core): QT += core
qtHaveModule(core5compat):  QT += core5compat
qtHaveModule(concurrent):   QT += concurrent
qtHaveModule(gui):  QT += gui
qtHaveModule(svg):  QT += svg
qtHaveModule(widgets):  QT += widgets
percent.target = %
percent.commands = @echo -n "\$(\$(@))\ "
QMAKE_EXTRA_TARGETS += percent
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Kornel Benko
Am Tue, 16 Mar 2021 18:21:19 +0100
schrieb Yu Jin :

> Am Di., 16. März 2021 um 16:36 Uhr schrieb Kornel Benko :
> 
> > Am Tue, 16 Mar 2021 16:32:49 +0100
> > schrieb Yu Jin :
> >
> > > Just seen this one and wanted to try it out obviously :)
> > > But it doesn't work for me on Windows. Using CMake GUI I notice that the
> > > dropdown menu LYX_USE_QT does not contain QT6, just QT5, QT4 and AUTO as
> > > before. When I choose AUTO it fails with:
> > >
> > > CMake Error at development/cmake/modules/FindQt4.cmake:568 (message):
> > >   Could NOT find QtCore.  Check
> > >   C:/lyx/masterbuild64Qt6/CMakeFiles/CMakeError.log for more details.
> > > Call Stack (most recent call first):
> > >   CMakeLists.txt:804 (find_package)
> > >
> > > It does find some QT6 stuff correctly though, like QT_PLUGINS_DIR, but
> > not
> > > everything, like QtCore.
> >
> > I have a patch ready, but cannot test.
> >
> 
> Care to share it? I can test.

Attached.

Kornel
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8ca0c10fd..b1ee3ab5b8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -217,11 +217,11 @@ else()
 unset(LYX_ENABLE_VALGRIND_TESTS CACHE)
   endif()
 endif()
 LYX_OPTION(ASAN "Use address sanitizer" OFF ALL)
 #LYX_COMBO(USE_FILEDIALOG"Use native or QT file dialog" QT NATIVE)
-LYX_COMBO(USE_QT"Use Qt version as frontend" AUTO QT4 QT5)
+LYX_COMBO(USE_QT"Use Qt version as frontend" AUTO QT4 QT5 QT6)
 LYX_COMBO(USE_IPO   "Interprocedural optimization" OFF AUTO ON)
 #LYX_OPTION(3RDPARTY_BUILD   "Build 3rdparty libs" OFF ALL)
 LYX_OPTION(DISABLE_CALLSTACK_PRINTING "do not print a callstack when crashing" OFF ALL)
 LYX_OPTION(EXTERNAL_Z   "OFF := Build 3rdparty lib zlib" ${DefaultExternalLibs} ALL)
 LYX_OPTION(EXTERNAL_DTL "OFF := Build 3rdparty commands dt2dv and dv2dt" ${DefaultExternalLibs} ALL)
@@ -741,36 +741,59 @@ if(LYX_XMINGW)
 	list(APPEND CMAKE_FIND_ROOT_PATH ${GNUWIN32_DIR})
 endif()
 
 set(min_qt5_version "5.6")
 if(LYX_USE_QT MATCHES "AUTO")
-	# try qt5 first
-	find_package(Qt5Core CONFIG QUIET)
-	if(Qt5Core_FOUND)
-		set(LYX_USE_QT "QT5" CACHE STRING "Valid qt version" FORCE)
+	# try qt6 first
+	find_package(Qt6Core CONFIG QUIET)
+	if (Qt6Core_Found)
+		set(LYX_USE_QT "QT6" CACHE STRING "Valid qt version" FORCE)
 		message(STATUS "Qt5Core_VERSION = ${Qt5Core_VERSION}")
-		if(Qt5Core_VERSION VERSION_LESS ${min_qt5_version})
-			find_package(Qt4 "4.5.0" QUIET)
-			if(QT4_FOUND)
-set(LYX_USE_QT "QT4" CACHE STRING "Valid qt version" FORCE)
-			endif()
-		endif()
 	else()
-		set(LYX_USE_QT "QT4" CACHE STRING "Valid qt version" FORCE)
+		find_package(Qt5Core CONFIG QUIET)
+		if(Qt5Core_FOUND)
+			set(LYX_USE_QT "QT5" CACHE STRING "Valid qt version" FORCE)
+			message(STATUS "Qt5Core_VERSION = ${Qt5Core_VERSION}")
+			if(Qt5Core_VERSION VERSION_LESS ${min_qt5_version})
+find_package(Qt4 "4.5.0" QUIET)
+if(QT4_FOUND)
+	set(LYX_USE_QT "QT4" CACHE STRING "Valid qt version" FORCE)
+endif()
+			endif()
+		else()
+			set(LYX_USE_QT "QT4" CACHE STRING "Valid qt version" FORCE)
+		endif()
 	endif()
 endif()
-if(LYX_USE_QT MATCHES "QT5")
+if(LYX_USE_QT MATCHES "QT6|QT5")
+	if (LYX_USE_QT MATCHES "QT6")
+		set(QtVal "Qt6")
+		macro (qt_add_resources)
+			Qt6_add_resources(${ARGN})
+		endmacro()
+		macro (qt_wrap_uifiles)
+			Qt6_wrap_ui(${ARGN})
+		endmacro()
+	else()
+		set(QtVal "Qt5")
+		macro (qt_add_resources)
+			Qt5_add_resources(${ARGN})
+		endmacro()
+		macro (qt_wrap_uifiles)
+			Qt5_wrap_ui(${ARGN})
+		endmacro()
+	endif()
 	# set QPA_XCB if QT uses X11
-	find_package(Qt5Core CONFIG REQUIRED)
-	if (Qt5Core_FOUND)
-		find_package(Qt5Widgets CONFIG REQUIRED)
+	find_package(${QtVal}Core CONFIG REQUIRED)
+	if (${QtVal}Core_FOUND)
+		find_package(${QtVal}Widgets CONFIG REQUIRED)
 		if(APPLE)
-			find_package(Qt5MacExtras CONFIG REQUIRED)
+			find_package(${QtVal}MacExtras CONFIG REQUIRED)
 		endif()
-		find_package(Qt5X11Extras CONFIG QUIET)
-		find_package(Qt5WinExtras CONFIG QUIET)
-		set(QTVERSION ${Qt5Core_VERSION})
+		find_package(${QtVal}X11Extras CONFIG QUIET)
+		find_package(${QtVal}WinExtras CONFIG QUIET)
+		set(QTVERSION ${${QtVal}Core_VERSION})
 		if (QTVERSION VERSION_LESS ${min_qt5_version})
 			message(STATUS "QTVERSION = \"${QTVERSION}\"")
 			message(STATUS "This version is not recommended, try either option -DLYX_USE_QT=QT4 or")
 			message(STATUS "install QT-Version >= \"${min_qt5_version}\"")
 			# see thread in lyx-devel list
@@ -779,23 +802,20 @@ if(LYX_USE_QT MATCHES "QT5")
 			# Subject: cmake compilation error
 			#message(FATAL_ERROR "Wrong Qt-Version")
 		endif()
 		macro (qt_use_modules lyxtarget)
 			foreach (_tg ${ARGN})
-find_package(Qt5${_tg} CONFIG REQUIRED)
-target_link_libraries(${lyxtarget} Qt5::${_tg})
+find_package(${QtVal}${_tg} CONFIG REQUIRED)
+target_link_libraries(${lyxtarget} ${QtVal}::${_tg})
 			endforeach()
 		endmacro()
-		macro (qt_add_resources)
-			qt5_add_resources($

Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Scott Kostyshak
On Tue, Mar 16, 2021 at 10:44:13AM +0100, Enrico Forestieri wrote:
> On Mon, Mar 15, 2021 at 10:52:19PM -0400, Scott Kostyshak wrote:
> > 
> > Are there still QRegExp that need to be changed? I got an error from
> > src/support/qstring_helpers.cpp.
> 
> I actually don't know. Let me explain. There should be a compatibility
> layer for using Qt5 constructs, so I didn't search for all occurrences
> of QRegExp's but only changed the places where I was getting compiling
> errors. The code in qstring_helpers.cpp compiled without issues for me
> on both Linux and Windows, and thus I did not touch it.

I see. I think I might be missing the compatibility layer module. When
installing Qt, I just chose the default Qt 6.0.2 but perhaps I need to
customize the installation to include the Qt5 compatibility module.

> What kind of error are you getting?

  CXX  qstring_helpers.o
qstring_helpers.cpp:21:10: fatal error: QRegExp: No such file or directory
   21 | #include 
  |  ^
compilation terminated.
make[5]: *** [Makefile:985: qstring_helpers.o] Error 1
make[5]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src/support'
make[4]: *** [Makefile:831: all] Error 2
make[4]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src/support'
make[3]: *** [Makefile:2588: all-recursive] Error 1
make[3]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src'
make[2]: *** [Makefile:1685: all] Error 2
make[2]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo/src'
make[1]: *** [Makefile:578: all-recursive] Error 1
make[1]: Leaving directory '/home/vbox/lyxbuilds/qttest/repo'
make: *** [Makefile:473: all] Error 2
"make" 285L, 54182C 

 285,3 Bot
> 
> > Also, why use
> > 
> >   #include 
> > 
> > in CategorizedCombo.cpp, but not other places?
> 
> Because it was the only place where I had to explicitly include it.

OK.

By the way, thanks for your work on this.

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Jürgen Spitzmüller
Am Dienstag, dem 16.03.2021 um 15:30 +0100 schrieb Jean-Marc
Lasgouttes:
> Needed, I do not know. I think it still works with Qt4.5 and we had
> one user at some time, but nobody knows whether it still compiles. In
> any case, it would be easy to fix if we got a report of broken LyX
> with 4.5 IMO.

IIRC master has some functions that were introduced in 4.7.

Jürgen



signature.asc
Description: This is a digitally signed message part
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Yu Jin
Am Di., 16. März 2021 um 16:36 Uhr schrieb Kornel Benko :

> Am Tue, 16 Mar 2021 16:32:49 +0100
> schrieb Yu Jin :
>
> > Just seen this one and wanted to try it out obviously :)
> > But it doesn't work for me on Windows. Using CMake GUI I notice that the
> > dropdown menu LYX_USE_QT does not contain QT6, just QT5, QT4 and AUTO as
> > before. When I choose AUTO it fails with:
> >
> > CMake Error at development/cmake/modules/FindQt4.cmake:568 (message):
> >   Could NOT find QtCore.  Check
> >   C:/lyx/masterbuild64Qt6/CMakeFiles/CMakeError.log for more details.
> > Call Stack (most recent call first):
> >   CMakeLists.txt:804 (find_package)
> >
> > It does find some QT6 stuff correctly though, like QT_PLUGINS_DIR, but
> not
> > everything, like QtCore.
>
> I have a patch ready, but cannot test.
>

Care to share it? I can test.
-- 
Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Kornel Benko
Am Tue, 16 Mar 2021 16:32:49 +0100
schrieb Yu Jin :

> Just seen this one and wanted to try it out obviously :)
> But it doesn't work for me on Windows. Using CMake GUI I notice that the
> dropdown menu LYX_USE_QT does not contain QT6, just QT5, QT4 and AUTO as
> before. When I choose AUTO it fails with:
> 
> CMake Error at development/cmake/modules/FindQt4.cmake:568 (message):
>   Could NOT find QtCore.  Check
>   C:/lyx/masterbuild64Qt6/CMakeFiles/CMakeError.log for more details.
> Call Stack (most recent call first):
>   CMakeLists.txt:804 (find_package)
> 
> It does find some QT6 stuff correctly though, like QT_PLUGINS_DIR, but not
> everything, like QtCore.

I have a patch ready, but cannot test.

Kornel


pgpnsqQ6fIuZS.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Yu Jin
Just seen this one and wanted to try it out obviously :)
But it doesn't work for me on Windows. Using CMake GUI I notice that the
dropdown menu LYX_USE_QT does not contain QT6, just QT5, QT4 and AUTO as
before. When I choose AUTO it fails with:

CMake Error at development/cmake/modules/FindQt4.cmake:568 (message):
  Could NOT find QtCore.  Check
  C:/lyx/masterbuild64Qt6/CMakeFiles/CMakeError.log for more details.
Call Stack (most recent call first):
  CMakeLists.txt:804 (find_package)

It does find some QT6 stuff correctly though, like QT_PLUGINS_DIR, but not
everything, like QtCore.
-- 
Eugene
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Kornel Benko
Am Tue, 16 Mar 2021 15:43:59 +0100
schrieb Enrico Forestieri :

> On Tue, Mar 16, 2021 at 11:08:03AM +0100, Kornel Benko wrote:
> > 
> > Why not use QRegularExpression as in src/lyxfind.cpp?  
> 
> What do you mean? Unconditionally replacing QRegExp? I don't think it
> can be done without dropping support for Qt4.
> 

I meant instead of Compatibility directly use QRegExp or QRegularExpression

if (QT_VERSION >= 0x05) {
// define some macros for QRegularExpression
}
else {
// define some macros for QRegExp
}

But that is maybe too much work.

Kornel


pgpiwXlG9nzBG.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Enrico Forestieri
On Tue, Mar 16, 2021 at 11:08:03AM +0100, Kornel Benko wrote:
> 
> Why not use QRegularExpression as in src/lyxfind.cpp?

What do you mean? Unconditionally replacing QRegExp? I don't think it
can be done without dropping support for Qt4.

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Jean-Marc Lasgouttes

Le 16/03/2021 à 10:48, Enrico Forestieri a écrit :

LyX 2.4 will still support Qt 4.8. I trust this is old enough :)


So, I infer that the attached patch is needed.


Needed, I do not know. I think it still works with Qt4.5 and we had one 
user at some time, but nobody knows whether it still compiles. In any 
case, it would be easy to fix if we got a report of broken LyX with 4.5 IMO.


JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Kornel Benko
Am Tue, 16 Mar 2021 10:44:13 +0100
schrieb Enrico Forestieri :

> On Mon, Mar 15, 2021 at 10:52:19PM -0400, Scott Kostyshak wrote:
> > 
> > Are there still QRegExp that need to be changed? I got an error from
> > src/support/qstring_helpers.cpp.  
> 
> I actually don't know. Let me explain. There should be a compatibility
> layer for using Qt5 constructs, so I didn't search for all occurrences
> of QRegExp's but only changed the places where I was getting compiling
> errors.

Why not use QRegularExpression as in src/lyxfind.cpp?

> The code in qstring_helpers.cpp compiled without issues for me
> on both Linux and Windows, and thus I did not touch it.
> What kind of error are you getting?
> 
> > Also, why use
> > 
> >   #include 
> > 
> > in CategorizedCombo.cpp, but not other places?  
> 
> Because it was the only place where I had to explicitly include it.
> 


Kornel


pgpyls7NZpIsj.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Enrico Forestieri
On Tue, Mar 16, 2021 at 09:28:03AM +0100, Jean-Marc Lasgouttes wrote:
> Le 16/03/2021 à 07:38, Andreas Nicolai a écrit :
> >   Hi All,
> > 
> > just looked into Qt6 for another project of mine and noticed that there
> > is actually nothing in Qt6 new, that's really needed. Same for Lyx - or
> > is there really any feature of Qt6 necessary?
> > 
> > So, I was wondering - Lyx is being used by a lot of people with not so
> > brand-new notebooks, and hardware, that won't even support upgrading to
> > newer os (talk about the older Macs for example, and quite a few 6
> > +years Linux boxes). Now, Qt6 has a compatibility limit and some of
> > these systems won't be able to run Lyx anylonger.
> 
> Hi Andreas,
> 
> LyX 2.4 will still support Qt 4.8. I trust this is old enough :)

So, I infer that the attached patch is needed.

-- 
Enrico
diff --git a/configure.ac b/configure.ac
index f258db9adf..17784742c4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,7 +149,7 @@ AC_CHECK_HEADERS(magic.h,
 ### setup the qt frontend.
 dnl The code below is not in a macro, because this would cause big
 dnl problems with the AC_REQUIRE contained in QT_DO_IT_ALL.
-QT_DO_IT_ALL([4.5.0])
+QT_DO_IT_ALL([4.8.0])
 AC_SUBST([FRONTENDS_SUBDIRS], [qt])
 FRONTEND_INFO="${FRONTEND_INFO}\
   Qt Frontend:\n\
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Enrico Forestieri
On Mon, Mar 15, 2021 at 10:52:19PM -0400, Scott Kostyshak wrote:
> 
> Are there still QRegExp that need to be changed? I got an error from
> src/support/qstring_helpers.cpp.

I actually don't know. Let me explain. There should be a compatibility
layer for using Qt5 constructs, so I didn't search for all occurrences
of QRegExp's but only changed the places where I was getting compiling
errors. The code in qstring_helpers.cpp compiled without issues for me
on both Linux and Windows, and thus I did not touch it.
What kind of error are you getting?

> Also, why use
> 
>   #include 
> 
> in CategorizedCombo.cpp, but not other places?

Because it was the only place where I had to explicitly include it.

-- 
Enrico
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Jean-Marc Lasgouttes

Le 16/03/2021 à 07:38, Andreas Nicolai a écrit :

  Hi All,

just looked into Qt6 for another project of mine and noticed that there
is actually nothing in Qt6 new, that's really needed. Same for Lyx - or
is there really any feature of Qt6 necessary?

So, I was wondering - Lyx is being used by a lot of people with not so
brand-new notebooks, and hardware, that won't even support upgrading to
newer os (talk about the older Macs for example, and quite a few 6
+years Linux boxes). Now, Qt6 has a compatibility limit and some of
these systems won't be able to run Lyx anylonger.


Hi Andreas,

LyX 2.4 will still support Qt 4.8. I trust this is old enough :)

Regards,

JMarc

--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Andreas Nicolai
Hi Stephan,

Am 16.03.21 um 08:01 schrieb Stephan Witt:

> That’s interesting. My plan was to go with the LTS versions of Qt.
> So I had the plan to use either 5.9.x or 5.12.x. I noticed already
> the incompatibility of 5.12.x with El Capitan. What can you say
> about the pros and cons of Qt 5.11 versus Qt 5.12? Are you confident
> with 5.11?

To my knowledge, the changes from 5.11.3 to 5.12.8 (shipped with Ubuntu
20.04 LTS) are not really needed in our project. If I recall correctly,
there were a few bug fixes that we have and had workarounds for (and
keeps these around), but nothing critical. For example, setting the
header font (size) for QTableWidget won't work correctly on Linux in
older Qt versions, but that's not much of an issue. To my knowledge, the
API of the standard widget classes hasn't changed in those revisions -
so the code for Qt 5.12.8 should equally compile on 5.11.3.

Since we generally develop on Ubuntu (I myself with 18.04 lts, others
with 20.04 lts), we normally have code compiling fine across this range
of Qt versions. In addition, we have a Jenkins slave running on a Mac El
Capitan box - so any compile time issues appear right away and can be
fixed with  #if QT_VERSION > 0x050b00  checks.

One thing, though: the stylesheet support has improved a lot in the
later Qt versions, and some features are not yet available/working
correctly in 5.9.5... but it seems the way Lyx handles colors appears to
be working quite well, already.

-Andreas
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-16 Thread Stephan Witt
Am 16.03.2021 um 07:38 schrieb Andreas Nicolai :
> 
> Hi All,
> 
> just looked into Qt6 for another project of mine and noticed that there
> is actually nothing in Qt6 new, that's really needed. Same for Lyx - or
> is there really any feature of Qt6 necessary?

Hi Andreas,

thank you for your mail.

> So, I was wondering - Lyx is being used by a lot of people with not so
> brand-new notebooks, and hardware, that won't even support upgrading to
> newer os (talk about the older Macs for example, and quite a few 6
> +years Linux boxes). Now, Qt6 has a compatibility limit and some of
> these systems won't be able to run Lyx anylonger.
> 
> My suggestions would be to make Qt6 compilation an optional thing, but
> keep code compilable with at least a sufficiently "old" and supported Qt
> version.

Yes, LyX will be compilable with older Qt versions in the future.

> In my other projects we have set MacOS El Capitan as compability limit,
> and the newest Qt version running on that system appears to be 5.11.3.
> So, that's what we stick to during development and, honestly, a lot of
> the newer features of Qt (or bug fixes) aren't really needed.

That’s interesting. My plan was to go with the LTS versions of Qt.
So I had the plan to use either 5.9.x or 5.12.x. I noticed already
the incompatibility of 5.12.x with El Capitan. What can you say
about the pros and cons of Qt 5.11 versus Qt 5.12? Are you confident
with 5.11?

> How about Lyx? Given the rather solid and standard Qt feature set used
> in Lyx, why not impose such a compatibility limit as well (at least let
> the code be compiling on those systems)? In case this is already
> considered, just ignore my rambling :-)

The option to compile LyX with elder Qt versions is one point. The other
question is wich version to use for regular package distribution. Here
we had some discussion in the past. I tend to be conservative here and
use the version usable on elder systems too.

Stephan

> Anyway, just a though...
> 
> -Andreas
> 
> Am 16.03.21 um 03:52 schrieb Scott Kostyshak:
>> On Mon, Mar 15, 2021 at 05:33:49PM +0100, Enrico Forestieri wrote:
>>> commit 635a7d77ddc94c63d52494dc4d68a930faccf45f
>>> Author: Enrico Forestieri 
>>> Date:   Mon Mar 15 17:09:09 2021 +0100
>>> 
>>>Allow compiling with Qt6
>>> 
>>>This commit allows compiling LyX with Qt6 when using autotools.
>>>For a successful compilation the following 2 conditions must be met.
>>> 
>>>1) The Qt6 qmake has to come first in PATH, so that the command
>>>   "qmake -v | grep -o 'Qt version .'" returns "Qt version 6".
>>>2) The --enable-qt6 switch has to be passed to the configure command.
>>> 
>>>If --enable-qt6 is used but Qt6 is not found, Qt5 is tried as a fallback.
>>>If also Qt5 is not found, configuring for Qt4 is attempted.
>>>If --enable-qt6 is not used, then things go as usual. This means that Qt5
>>>is tried first and then Qt4, unless --disable-qt5 is used, in which case
>>>Qt4 is directly attempted. This means that existing scripts should
>>>continue working unmodified.
>>> 
>>>LyX should compile with Qt6 on windows and linux, and possibly also on
>>>mac, but I could not test that. However, it is not guaranteed that it
>>>works as it should. In particular I am not sure that I got right the
>>>conversion from QRegExp to QRegularExpression. For sure, the syntax
>>>highlighting seems to not work right. Someone in the know should take
>>>a look at that. I am able to load documents and compile them but some
>>>thourough testing is needed. However, when compiling for Qt5 or Qt4,
>>>I tried to make sure that the functionality is preserved.
>>> ---
>> 
>> Are there still QRegExp that need to be changed? I got an error from
>> src/support/qstring_helpers.cpp.
>> 
>> Also, why use
>> 
>>  #include 
>> 
>> in CategorizedCombo.cpp, but not other places?
>> 
>> Scott
>> 
>> 
> 
> -- 
> lyx-devel mailing list
> lyx-devel@lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-15 Thread Andreas Nicolai
 Hi All,

just looked into Qt6 for another project of mine and noticed that there
is actually nothing in Qt6 new, that's really needed. Same for Lyx - or
is there really any feature of Qt6 necessary?

So, I was wondering - Lyx is being used by a lot of people with not so
brand-new notebooks, and hardware, that won't even support upgrading to
newer os (talk about the older Macs for example, and quite a few 6
+years Linux boxes). Now, Qt6 has a compatibility limit and some of
these systems won't be able to run Lyx anylonger.

My suggestions would be to make Qt6 compilation an optional thing, but
keep code compilable with at least a sufficiently "old" and supported Qt
version.

In my other projects we have set MacOS El Capitan as compability limit,
and the newest Qt version running on that system appears to be 5.11.3.
So, that's what we stick to during development and, honestly, a lot of
the newer features of Qt (or bug fixes) aren't really needed.

How about Lyx? Given the rather solid and standard Qt feature set used
in Lyx, why not impose such a compatibility limit as well (at least let
the code be compiling on those systems)? In case this is already
considered, just ignore my rambling :-)

Anyway, just a though...

-Andreas

Am 16.03.21 um 03:52 schrieb Scott Kostyshak:
> On Mon, Mar 15, 2021 at 05:33:49PM +0100, Enrico Forestieri wrote:
>> commit 635a7d77ddc94c63d52494dc4d68a930faccf45f
>> Author: Enrico Forestieri 
>> Date:   Mon Mar 15 17:09:09 2021 +0100
>>
>> Allow compiling with Qt6
>>
>> This commit allows compiling LyX with Qt6 when using autotools.
>> For a successful compilation the following 2 conditions must be met.
>>
>> 1) The Qt6 qmake has to come first in PATH, so that the command
>>"qmake -v | grep -o 'Qt version .'" returns "Qt version 6".
>> 2) The --enable-qt6 switch has to be passed to the configure command.
>>
>> If --enable-qt6 is used but Qt6 is not found, Qt5 is tried as a fallback.
>> If also Qt5 is not found, configuring for Qt4 is attempted.
>> If --enable-qt6 is not used, then things go as usual. This means that Qt5
>> is tried first and then Qt4, unless --disable-qt5 is used, in which case
>> Qt4 is directly attempted. This means that existing scripts should
>> continue working unmodified.
>>
>> LyX should compile with Qt6 on windows and linux, and possibly also on
>> mac, but I could not test that. However, it is not guaranteed that it
>> works as it should. In particular I am not sure that I got right the
>> conversion from QRegExp to QRegularExpression. For sure, the syntax
>> highlighting seems to not work right. Someone in the know should take
>> a look at that. I am able to load documents and compile them but some
>> thourough testing is needed. However, when compiling for Qt5 or Qt4,
>> I tried to make sure that the functionality is preserved.
>> ---
>
> Are there still QRegExp that need to be changed? I got an error from
> src/support/qstring_helpers.cpp.
>
> Also, why use
>
>   #include 
>
> in CategorizedCombo.cpp, but not other places?
>
> Scott
>
>

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-15 Thread Scott Kostyshak
On Mon, Mar 15, 2021 at 05:33:49PM +0100, Enrico Forestieri wrote:
> commit 635a7d77ddc94c63d52494dc4d68a930faccf45f
> Author: Enrico Forestieri 
> Date:   Mon Mar 15 17:09:09 2021 +0100
> 
> Allow compiling with Qt6
> 
> This commit allows compiling LyX with Qt6 when using autotools.
> For a successful compilation the following 2 conditions must be met.
> 
> 1) The Qt6 qmake has to come first in PATH, so that the command
>"qmake -v | grep -o 'Qt version .'" returns "Qt version 6".
> 2) The --enable-qt6 switch has to be passed to the configure command.
> 
> If --enable-qt6 is used but Qt6 is not found, Qt5 is tried as a fallback.
> If also Qt5 is not found, configuring for Qt4 is attempted.
> If --enable-qt6 is not used, then things go as usual. This means that Qt5
> is tried first and then Qt4, unless --disable-qt5 is used, in which case
> Qt4 is directly attempted. This means that existing scripts should
> continue working unmodified.
> 
> LyX should compile with Qt6 on windows and linux, and possibly also on
> mac, but I could not test that. However, it is not guaranteed that it
> works as it should. In particular I am not sure that I got right the
> conversion from QRegExp to QRegularExpression. For sure, the syntax
> highlighting seems to not work right. Someone in the know should take
> a look at that. I am able to load documents and compile them but some
> thourough testing is needed. However, when compiling for Qt5 or Qt4,
> I tried to make sure that the functionality is preserved.
> ---

Are there still QRegExp that need to be changed? I got an error from
src/support/qstring_helpers.cpp.

Also, why use

  #include 

in CategorizedCombo.cpp, but not other places?

Scott


signature.asc
Description: PGP signature
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-15 Thread Richard Kimberly Heck

On 3/15/21 1:13 PM, Pavel Sanda wrote:

On Mon, Mar 15, 2021 at 05:57:38PM +0100, Kornel Benko wrote:

Am Mon, 15 Mar 2021 17:33:49 +0100 (CET)
schrieb Enrico Forestieri :


commit 635a7d77ddc94c63d52494dc4d68a930faccf45f
Author: Enrico Forestieri 
Date:   Mon Mar 15 17:09:09 2021 +0100

 Allow compiling with Qt6

I had the impression we wanted to postpone compilation with Qt6 to after 2.4?

If the transition is that simple as this patch I think we should accept it now.
I am pretty sure ppl will try to adapt 2.4 to qt6 later on, so this is more 
safer anyway.


Yes, most of it is pretty straightforward syntax changes.

Riki


--
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-15 Thread Pavel Sanda
On Mon, Mar 15, 2021 at 05:57:38PM +0100, Kornel Benko wrote:
> Am Mon, 15 Mar 2021 17:33:49 +0100 (CET)
> schrieb Enrico Forestieri :
> 
> > commit 635a7d77ddc94c63d52494dc4d68a930faccf45f
> > Author: Enrico Forestieri 
> > Date:   Mon Mar 15 17:09:09 2021 +0100
> > 
> > Allow compiling with Qt6
> 
> I had the impression we wanted to postpone compilation with Qt6 to after 2.4?

If the transition is that simple as this patch I think we should accept it now.
I am pretty sure ppl will try to adapt 2.4 to qt6 later on, so this is more 
safer anyway.

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Allow compiling with Qt6

2021-03-15 Thread Kornel Benko
Am Mon, 15 Mar 2021 17:33:49 +0100 (CET)
schrieb Enrico Forestieri :

> commit 635a7d77ddc94c63d52494dc4d68a930faccf45f
> Author: Enrico Forestieri 
> Date:   Mon Mar 15 17:09:09 2021 +0100
> 
> Allow compiling with Qt6

I had the impression we wanted to postpone compilation with Qt6 to after 2.4?

Kornel


pgpiQe0BfrUu_.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel