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.
This is a variant of Input for layout files that only searches build
and system directories and thus allows "InputGlobal name.inc" in a user
file name.inc that attempts to modify its global counterpart.
At the moment, there is no support for plurals and capitalization.
A long comment explains why. Support could be added for that without
a format change.
References to environment variables embedded in a filename are expanded
and replaced by their value. However, if a variable does not exist, its
reference is simply erased from the filename, causing havoc (see #7801).
This has been like that since ever and cannot be changed, both for
backward compatibility and because this feature is currently used in
the Windows installer.
A possible backward compatible strategy is leaving as is the reference
to the environment variable (introduced by a $ sign) in the filename
if it does not exist. This is done in this patch, which also assumes
that an escape character is never used in a filename (inserting a $ in
the filename is easy, but I don't think one is able to easily insert
an escape character).
boost/signals2.hpp is a convenience header, it seems that
boost/signals2/signal.hpp is enough for our needs.
This allows to get rid of 6MiB of header files in 3rdparty/boost (and
probably to speed-up compilation).
1/ remove boost regex code from 3rdparty/boost. Only the cmake stuff remains.
2/ remove traces of BOOST_LIB since there is no need anymore to
compile boost stuff.
3/ remove traces of boost regexp in config/lyxinclude.m4 and INSTALL
4/ require gcc 4.9 as minimal version in autoconf.
Unfortunately, the net gain is only 10% of included boost size (now 21M).
This restores the debug output as it was intended before the
introduction of the LYXERR macro that was unconditionally outputing
an end of line. This is how this output was appearing until lyx 1.5:
Looking for font family cmr10 ... got: cmr10
got it normal!
instead of as it was since lyx 1.6 and until now:
Looking for font family cmr10 ...
got: cmr10
got it
normal!
Using US english desktop language LyX's Mac OS adds some items to the view menu:
1. Show/Hide Tab Bar and
2. Enter Full Screen
These items won't work properly and it's better to hide them.
Mac OS adds two extra menu entries to the edit menu.
These menu items are:
1. Start Dictation...
2. Emoji & Symbols
Both menu items don't work with LyX.
Therefore they shouldn't be present and the new code hides them.
This patch aims at:
1. replacing absolute paths by their hashes (do not leak directory structures)
2. not using counters anymore so that changing figures order in the document
does not lead to large number of obsolete images in export directory.
Other changes than in xHTML export of images are unintended.
The is a fixup to commit 611df441. It seems that the wrong unicode
property was selected. It could be that both classes should be used.
Fixes bug #11900.
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.
Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added. Additionally, the
method retirns end() when position is equal to the size of the
container (see #11861).
lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.
Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added.
lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
This inset allows counters to be set, reset, saved, restored, etc,
both in the LyX GUI and in the output; optionally, the effect can be
limited to the GUI. Of course, LaTeX provides means for doing all of
these things, so they could previously be done with ERT, as far as
the output is concerned. But there was no mechanism for manipulating
counters in the GUI and none for other output formats.
This should work on Windows, but needs test.
The changes (namely the installation directory for the dtl executables)
for automake are not yet done. (JMarc?)
It may fix bug #11325 if cmake configured with '-DLYX_EXTERNAL_DTL=OFF'
This commit fixes a couple of warnings from Qt 5.14 like the
following one:
error: ‘int QTime::restart()’ is deprecated: Use QElapsedTimer instead [-Werror=deprecated-declarations]
This commit changes two uses of QTime to QElapsedTimer, one used
only when the "files" debug flag is set, and the other for timing
whether a script (e.g., knitr) takes longer than a certain amount of
time to run.
QElapsedTimer is superior for these two use cases in that it uses a
monotonic clock if possible, and is thus more robust to certain
changes (e.g., daylight savings changes) [1]. Similarly, the commit
in Qt Base that makes this deprecation [2] mentions the following in
the commit message:
QElapsedTimer does the job better and without the DST kludges.
Note that QElapsedTimer class was introduced in Qt 4.7, so no
conditioning on Qt version is necessary.
Not all methods of QTime are deprecated and we still use some of
the non-deprecated methods in our code (e.g., to get the current
wall clock time in GuiProgress::currentTime()).
[1] https://doc.qt.io/qt-5/qelapsedtimer.html
[2] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=ed99a591a83a399458f12341d0a1c0b3152f247a
The realPath() implementation on Windows works only for files and
not for directories. By using an API available starting from Vista
it is possible to fix it in a simple way.
I also took into account using the Qt QFileInfo::canonicalFilePath(),
but it turns out to not work when a path component is a junction
(tested with Qt 5.14.1).
Due to this, it is not possible compiling or using LyX on Windows
versions earlier than Vista.