[texworks] Qt5 support

Stefan Löffler st.loeffler at gmail.com
Fri Jan 9 08:39:32 CET 2015


Hi,

thanks a lot for the effort.

On 08.01.2015 11:10, Vladimir Lomov wrote:
> Ok, it was interesting experience to use CMake as "config" system
> instead of .pro file. I made new patches, one to make possible to
> compile vs. Qt5 (qt5.patch)

This one puzzles me a bit. I compiled with Qt 5.1 and Qt 5.3.2, and it
worked fine without the patch in both cases. In fact, the Qt 5.4
documentation (http://doc.qt.io/qt-5/qapplication.html) also claims that
is enough to write #include <QApplication>, provided the build system is
set up correctly (in which case the QtWidgets subdirectory should be in
the list of include directories). The same thing applies to QAction,
QMainWindow, QMessageBox,.... I would have assumed that this is a
problem with the CMake configuration, but apparently you had the same
issue with qmake, which might hint either at a Qt bug, or at an issue of
both systems picking up the directories in your configuration.

Do you only have Qt 5.4 installed (i.e., no other version of Qt 5 and no
Qt 4)?
Could you send me the compiler command line (e.g., TWScript.cpp)? To see
it, you probably need to invoke `make VERBOSE=1`. If you want, you can
also send it to me off-list.

> and the other (cmake-i18n.patch) to install
> qm files while building TeXworks on Linux.

Thanks. The QLibraryInfo approach looks very interesting. I will look
into it (particularly the question in which order the translations are
used) and then commit it.
Regarding the installation of the .qm files: this actually should not be
necessary. Those files should be bundled into the texworks application
itself (by QT_ADD_QM_TRANSLATIONS in src/CMakeLists.txt). The reason is
that the Tw-specific translations are probably not much use for other
programs (first, because they depend on the exact strings used in Tw,
and second because other programs usually won't look for TeXworks_*.qm
files). So, I don't think that installing them system-wide (and
especially in a directory "owned" by qt) is a good idea.
If they are not picked up, that's a different problem that we should
investigate separately (possibly the resource file listing all the
translations does not get created properly)?

All the best,
Stefan


More information about the texworks mailing list