lxqt / qtermwidget

The terminal widget for QTerminal
https://lxqt.github.io
GNU General Public License v2.0
490 stars 248 forks source link

Build with Qt6 #532

Closed doug1234 closed 4 months ago

doug1234 commented 6 months ago

Builds and the example runs with qt 6.6.0 on rhel9 with no new warnings. Currently using the qt5 compatibility library as was suggested in other pull requests.

Issue: The cursor is drawn farther to the right then it should be. This was not an issue for me with qt5. Looing into. Issue: Text is sized differently when selected. This makes an odd effect. This was not an issue for me with qt5.

TODO: Update documentation.

doug1234 commented 4 months ago

Found an issue: after 0f2cbfeaecd2de38712b7784e50849d80fba1556, URLs are not underlined when hovered. I suspect changes in Filter.cpp break it, as that class is for filtering specific patterns (ex: URLs) from terminal contents.

Will the Qt6 port of QTerminal be ready before the next release, which will happen around Apr 15, 2024?

@tsujan It seems remaining work may not be trivial. I prefer to postpone Qt 6 port of qtermwidget to the next LXQt release.

I should be able to take a look early next week. I wouldn't expect the fix to be too difficult.

yan12125 commented 4 months ago

Thanks for the kind help. If the URL issue is resolved before LXQt 2.0, it's still good to postpone the Qt 6 version, as overall changes in this PR are non-trivial and require intensive testing.

doug1234 commented 4 months ago

Thanks for the kind help. If the URL issue is resolved before LXQt 2.0, it's still good to postpone the Qt 6 version, as overall changes in this PR are non-trivial and require intensive testing.

OK. I am pretty sure I already see the mistake that caused this. It should be a super quick fix. But schedule the release for whenever you think is best.

tsujan commented 4 months ago

No need to worry about the release date. We could release the port whenever it's thoroughly tested. I added a note to the draft of the release announcement of LXQt 2.0.0:. Check if it's good enough:

"QTerminal is the only app whose Qt6 port will be released separately -- complications were encountered due to the removal of legacy encodings from Qt6. Until then, its Qt5 version 1.4.0 could be used."

doug1234 commented 4 months ago

Anchored pattern was not necessary for urls. Removing that got URLs working as they do in qt5.

yan12125 commented 4 months ago

Thanks! I will test again and finish cleaning up the qterminal PR these two days, and then both can be merged. If you wish, you can do a rebase and cleanup some commits (ex: previous attempts for Qt6 compatibility). It's also fine to skip further cleanups - I will merge all commits as-is.

doug1234 commented 4 months ago

Great! I think I am going to leave it as is unless you find something else.

yan12125 commented 4 months ago

Here we go :tada:

isf63 commented 4 months ago

I'm unsure on how to get the QTermWidget bindings from PyQt6 to build. With both python-pyqt5 and python-pyqt6 installed it selects PyQt5. Didn't see anything in the Arch PKGBUILD that changes that.

marcusbritanicus commented 4 months ago

@isf63 have a look at this. We're using this command to generate the PyQt6 bindings.

isf63 commented 4 months ago

@marcusbritanicus: Thanks, that got me further, but still no complete success:

Generating the QTermWidget bindings...
/usr/lib/python3.11/site-packages/PyQt6/bindings/QtCore/QtCoremod.sip: line 64: '%Plugin' is deprecated and will be removed in SIP v7.0.0
Generating the .pro file for the QTermWidget module...
Generating the top-level .pro file...
Generating the Makefiles...
/usr/bin/qmake6 -recursive QTermWidget.pro
Info: creating stash file /tmp/tmpx8qs774o/.qmake.stash
Reading /tmp/tmpx8qs774o/QTermWidget/QTermWidget.pro
Compiling the project...
make
cd QTermWidget/ && ( test -e Makefile || /usr/bin/qmake6 -o Makefile /tmp/tmpx8qs774o/QTermWidget/QTermWidget.pro ) && make -f Makefile 
make[1]: Entering directory '/tmp/tmpx8qs774o/QTermWidget'
g++ -c -pipe -I/tmp/makepkg/qtermwidget-git/src/qtermwidget/pyqt/../lib -I/tmp/makepkg/qtermwidget-git/src/qtermwidget/pyqt/../build/lib -fno-exceptions -Wall -Wextra -mno-direct-extern-access -D_REENTRANT -fPIC -DPy_LIMITED_API=0x03080000 -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I.. -I/usr/include/python3.11 -I/usr/include/qt6 -I/usr/include/qt6/QtWidgets -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtCore -I. -I/usr/lib/qt6/mkspecs/linux-g++ -o sipQTermWidgetcmodule.o sipQTermWidgetcmodule.cpp
g++ -c -pipe -I/tmp/makepkg/qtermwidget-git/src/qtermwidget/pyqt/../lib -I/tmp/makepkg/qtermwidget-git/src/qtermwidget/pyqt/../build/lib -fno-exceptions -Wall -Wextra -mno-direct-extern-access -D_REENTRANT -fPIC -DPy_LIMITED_API=0x03080000 -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I. -I.. -I/usr/include/python3.11 -I/usr/include/qt6 -I/usr/include/qt6/QtWidgets -I/usr/include/qt6/QtGui -I/usr/include/qt6/QtCore -I. -I/usr/lib/qt6/mkspecs/linux-g++ -o sipQTermWidgetQTermWidget.o sipQTermWidgetQTermWidget.cpp
In file included from /tmp/makepkg/qtermwidget-git/src/qtermwidget/pyqt/../lib/qtermwidget.h:25,
                 from /tmp/makepkg/qtermwidget-git/src/qtermwidget/pyqt/sip/qtermwidget.sip:14:
/tmp/makepkg/qtermwidget-git/src/qtermwidget/pyqt/../lib/Emulation.h:36:10: fatal error: qtermwidget_export.h: No such file or directory
   36 | #include "qtermwidget_export.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
marcusbritanicus commented 4 months ago

@isf63 Right. I tried to compile on a fresh setup. I too hit this error. The simplest solution is to install the C++ library first. Then you can compile and install the pyqt bindings. How this works on the ci I am not sure.