Lazarus

Programming => Widgetset => QT => Topic started by: Zoë on January 18, 2021, 07:23:49 am

Title: QT 6?
Post by: Zoë on January 18, 2021, 07:23:49 am
I know QT 6 just came out, but is anyone looking into what it'll take to update the LCL bindings for it?  One of our users just pointed out that QT 5.14 is EOL this December, and 5.15 is a commercial only LTS release.

https://en.wikipedia.org/wiki/Qt_version_history
Title: Re: QT 6?
Post by: zeljko on January 18, 2021, 09:18:21 am
Qt6 bindings should be started when first Qt6 LTS is released (AFAIR it's 6.2)
Title: Re: QT 6?
Post by: marcov on January 18, 2021, 09:43:46 am
Qt6 bindings should be started when first Qt6 LTS is released (AFAIR it's 6.2)

Will there be a public 6.2 lts?
Title: Re: QT 6?
Post by: zeljko on January 18, 2021, 01:05:31 pm
Qt6 bindings should be started when first Qt6 LTS is released (AFAIR it's 6.2)

Will there be a public 6.2 lts?

Probably not, but I'm looking for stable api.
Title: Re: QT 6?
Post by: zeljko on November 10, 2022, 07:19:13 pm
Old topic, but fresh news :) qt6 release will be based on lts Qt-6.2.3  which is lgpl and installed on most modern distros.
Title: Re: QT 6?
Post by: Zoë on November 10, 2022, 08:17:13 pm
Good to hear!  :) I assume there will be a new qt6 widgetset backend?  We'll definitely give it a thorough testing once it lands.
Title: Re: QT 6?
Post by: zeljko on November 11, 2022, 02:22:24 am
It already works here, I'm using lazarus qt6 for almost 1 month in virtual machine, fixing some wayland stuff before commiting.
Title: Re: QT 6?
Post by: dbannon on November 11, 2022, 06:58:31 am
hey, thats fantastic news Zeljko, we'd all like to have a play with what you have now.

Davo
Title: Re: QT 6?
Post by: El Salvador on November 11, 2022, 11:09:37 am
It already works here, I'm using lazarus qt6 for almost 1 month in virtual machine, fixing some wayland stuff before commiting.
Oh my! Beautiful news!
Title: Re: QT 6?
Post by: zeljko on November 11, 2022, 03:16:43 pm
Here's first screenshoot of Lazarus IDE using qt6 widgetset...just for history books :)
Title: Re: QT 6?
Post by: zeljko on November 11, 2022, 06:42:10 pm
Commited :)
Title: Re: QT 6?
Post by: cpalx on November 11, 2022, 06:53:54 pm
i want to installlllllllllll
Title: Re: QT 6?
Post by: AlexTP on November 11, 2022, 06:58:07 pm
Is libQt6Pas needed for this Qt6? Where to get it?

EDITED
Yes.

quote: To use them you also need to download and install at appropriate place the libQt6Pas.so (linux) or Qt6Pas.dll (ms windows) or Qt6Pas.framework (Darwin).
Title: Re: QT 6?
Post by: Leledumbo on November 11, 2022, 07:13:26 pm
Here's first screenshoot of Lazarus IDE using qt6 widgetset...just for history books :)
This forum needs like / love button to appreciate such a work.
Title: Re: QT 6?
Post by: dbannon on November 12, 2022, 02:37:55 am
Hi Zeljko, this really is great news.

However (there is always a 'however') I cannot build the library on Debian Testing. What distro are you using for your development please ?
Debian Bullseye does not have Qt6 and Testing is, well testing, so not always stable.

EDIT: Builds on Fedora 36

On Debian testing I see after what must be a good part of the build is done -
........
Code: Bash  [Select][+][-]
  1. g++ -pipe -Wfatal-errors -O2 -w -dM -E -o tmp/moc_predefs.h /usr/lib/x86_64-linux-gnu/qt6/mkspecs/features/data/dummy.cpp
  2. /usr/lib/qt6/libexec/moc -DBINUX -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include /home/dbannon/libqt6pas/cbindings/tmp/moc_predefs.h -I/usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -I/home/dbannon/libqt6pas/cbindings -I/usr/include/x86_64-linux-gnu/qt6 -I/usr/include/x86_64-linux-gnu/qt6/QtPrintSupport -I/usr/include/x86_64-linux-gnu/qt6/QtWidgets -I/usr/include/x86_64-linux-gnu/qt6/QtGui -I/usr/include/x86_64-linux-gnu/qt6/QtCore -I/usr/include/c++/11 -I/usr/include/c++/11/x86_64-redhat-linux -I/usr/include/c++/11/backward -I/usr/lib/gcc/x86_64-redhat-linux/11/include -I/usr/local/include -I/usr/include src/qobject_hook.h -o tmp/moc_qobject_hook.cpp
  3. usr/include/c++/11/bits/stl_relops.:67:1: error: Parse error at "std"

The line it refers to, in stl_relops.h is show below -
Code: C  [Select][+][-]
  1. /** @file bits/stl_relops.h
  2.  *  This is an internal header file, included by other library headers.
  3.  *  Do not attempt to use it directly. @headername{utility}
  4.  *
  5.  *  Inclusion of this file has been removed from
  6.  *  all of the other STL headers for safety reasons, except std_utility.h.
  7.  *  For more information, see the thread of about twenty messages starting
  8.  *  with http://gcc.gnu.org/ml/libstdc++/2001-01/msg00223.html, or
  9.  *  http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.ambiguous_overloads
  10.  *
  11.  *  Short summary: the rel_ops operators should be avoided for the present.
  12.  */
  13.  
  14. #ifndef _STL_RELOPS_H
  15. #define _STL_RELOPS_H 1
  16.  
  17. namespace std _GLIBCXX_VISIBILITY(default)      // <<<< This is line refereed to.
  18. {
  19. _GLIBCXX_BEGIN_NAMESPACE_VERSION
  20. .....

It appears that someone is quite uncomfortable with the use of this specific stl_relops at least. Perhaps debian is behind the game here a bit ?

PS : due to this announcement, the next release of my app (due in a few days) to the Debian Repo will be the Qt5 version.  8-)

Davo

Title: Re: QT 6?
Post by: dbannon on November 12, 2022, 03:48:55 am
Comparing the header files, stl_relops.h from Debian Testing (fails) and Fedora 36 (OK) there is no code differences, different comments but similar sorts of messages.

the Fedora .h file is slightly newer so, perhaps the underlying code is different ?

Davo
Title: Re: QT 6?
Post by: dbannon on November 12, 2022, 04:17:56 am
Zeljko, I am puzzled about the version numbering you have used for the library. Seems its called libQt6Pas.so.6.2.3

I assume the '6' is for Qt6, the '2.3' being the version of Qt6 you are using as a reference. By locking you self into that version number, you now have no where to go if you want to increment it (without looking as if it no longer works with Qt6 2.3). Is that intentional ?

And end users will be worried about using libQt6Pas.so.6.2.3 with eg Qt6.3.1 (both Fedora 36 and Debian Testing are already on 3.1).

I suggest you have a separate numbering scheme altogether. Linking the number to Lazarus is not good because you release into main and you don't know, then, which Lazarus Release it will appear in later.

Why not just call it libQt6Pas.so.6.1.0 at this stage ?  You have done so much work on this, it deserves its own version number.

Davo
Title: Re: QT 6?
Post by: dbannon on November 12, 2022, 05:39:24 am
Unbelievable ! Seriously, this is amazing !  Here is my app, running Qt6 -

27K lines of code and all I had to do was to add a {ifdef LCLQt6} in one spot.

Absolutely brilliant Zeljko, thank you so much !

Davo

PS - I will get some packaged versions of the library in place as soon as I can.
Title: Re: QT 6?
Post by: dbannon on November 12, 2022, 05:45:16 am
And a scaled version of that image, yeah, I was getting a bit excited !

Davo
Title: Re: QT 6?
Post by: dsiders on November 12, 2022, 06:11:57 am
And a scaled version of that image, yeah, I was getting a bit excited !

Davo

So.. which distro is that running in the VM?
Title: Re: QT 6?
Post by: dbannon on November 12, 2022, 10:14:16 am
The VM is Debian Testing XFCe but with a libQt6Pas built on Fedora 36.

Davo
Title: Re: QT 6?
Post by: zeljko on November 12, 2022, 11:58:53 am
I'm building on Fedora 35, seem that your debian does not meet qt6 dependencies about compiler.
This is error from Lazarus CI: Qt screams about C++17 compiler.
g++ -c -pipe -Wfatal-errors -O2 -w -D_REENTRANT -fPIC -DBINUX -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I. -I/usr/include/x86_64-linux-gnu/qt6 -I/usr/include/x86_64-linux-gnu/qt6/QtPrintSupport -I/usr/include/x86_64-linux-gnu/qt6/QtWidgets -I/usr/include/x86_64-linux-gnu/qt6/QtGui -I/usr/include/x86_64-linux-gnu/qt6/QtCore -Itmp -I/usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -o tmp/qobject_hook_c.o src/qobject_hook_c.cpp
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qnamespace.h:44,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qobjectdefs.h:48,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qobject.h:46,
                 from src/qobject_hook.h:17,
                 from src/qobject_hook_c.h:15,
                 from src/qobject_hook_c.cpp:12:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:143:6: error: #error "Qt requires a C++17 compiler"
  143 | #    error "Qt requires a C++17 compiler"
      |      ^~~~~
compilation terminated due to -Wfatal-errors.
Title: Re: QT 6?
Post by: dbannon on November 12, 2022, 12:33:15 pm
Well, thats pretty cute given they are shipping Qt6 2.3.1 - it does not met Qt spec ??

Anyway, I had no trouble building on Fedora 36, I have made a pair of x86_64 libraries and placed them in my existing libQt5pas repo -

https://github.com/davidbannon/libqt5pas/releases/tag/v1.2.10

For the record, here is how their file names come out -
Code: [Select]
libqt6pas6_2_3-0_amd64.deb
libqt6pas-dev_2_3-0_amd64.deb

If I get a chance tomorrow, I will see if I can make some rpms and maybe even arm versions.

But before people start installing these, it might be nice if you could consider the version numbering system please ?

Davo

Title: Re: QT 6?
Post by: dbannon on November 12, 2022, 12:48:42 pm
.......
/usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:143:6: error: #error "Qt requires a C++17 compiler"
  143 | #    error "Qt requires a C++17 compiler"
      |      ^~~~~
compilation terminated due to -Wfatal-errors.
OK, Debian Testing, aka bookworm, uses GCC 12.2, according to gcc website, version 11 does have the C++17 features.

C++17 features are available since GCC 5. This mode is the default in GCC 11; it can be explicitly selected with the -std=c++17 command-line flag, or -std=gnu++17 to enable GNU extensions as well.

If they are year 2017 standards, that should not be a problem. You seemed to be getting a much more informative error report than I did, do you know why ?

Davo
Title: Re: QT 6?
Post by: zeljko on November 12, 2022, 12:52:48 pm
Yes, we must add -std=c++17 on Debian to get it work.
Title: Re: QT 6?
Post by: theo on November 12, 2022, 08:08:22 pm
Here's first screenshoot of Lazarus IDE using qt6 widgetset...just for history books :)

Thank you Željan for your tireless commitment.  :)
I will test as soon as possible.
Title: Re: QT 6?
Post by: dbannon on November 13, 2022, 01:24:22 am
Yes, we must add -std=c++17 on Debian to get it work.

Yep, that fixed it. Do you want to edit Qt6Pas.pro your self or want me to make a pull request ?

I guess we have to put it down to a Debian-ism, they can be very conservative !

Davo
Title: Re: QT 6?
Post by: zeljko on November 13, 2022, 10:32:25 am
Make pull request please ... also, change version to 6.2.0 instead of 6.2.3 (me culpa). Version will be 6.2 (it is based on 6.2), and micro version will be changed for changes in bindings.

EDIT: It's already fixed ! https://gitlab.com/freepascal.org/lazarus/lazarus/-/commit/0f6a659df293e09cb63423b8c89f3dc372d23b74
Title: Re: QT 6?
Post by: dbannon on November 14, 2022, 02:59:14 am

Libraries

Pre made libqt6pas libraries available at https://github.com/davidbannon/libqt6pas

Debs, RPMs and a tarball. Only x86_64 so far but arm and arm64 at some stage.

Compile and Version Numbering
I can confirm that  Maxim has fixed the compile on Debian issue but has not reset the version number. I'll wait a bit and if it happens, great, if not, I'll do you a pull request. For the record, I have used what we have there now, after Maxim's patch, as version 6.2.0.

Simple edit of Qt6Pas.pro starting at line 13 -
Code: C  [Select][+][-]
  1. # Binding Release Version 6.2.0 against Qt6 6.2 LTS release.
  2. # Changes to Binding will trigger updates to the third component in version number
  3. # So, next one will be 6.2.1
  4.  
  5. win32:VERSION = 6.2.0.0
  6. else:VERSION = 6.2.0
  7. VER_MAJ = 6
  8. VER_MIN = 2
  9. VER_PAT = 0
Title: Re: QT 6?
Post by: zeljko on November 14, 2022, 09:38:18 am
I'll change version later. 6.2 will stay as it is, micro version number will be changed 0..xx.
Title: Re: QT 6?
Post by: El Salvador on November 14, 2022, 06:17:34 pm
I'm trying build Lazarus 2.3.0 (rev main-2_3-2831-gbff5a39d0b) with libqt6pas built by dbannon, but I have these errors:
Quote
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `QWidget::addAction(QIcon const&, QString const&, QObject const*, char const*, Qt::ConnectionType)@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `qt_version_tag@Qt_6.3'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `QWidget::addAction(QString const&)@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `operator>>(QDataStream&, QTextCharFormat&)@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `QPolygon::setPoint(int, int, int)@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `QWidget::addAction(QIcon const&, QString const&)@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `QWidget::addAction(QString const&, QObject const*, char const*, Qt::ConnectionType)@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `operator<<(QDataStream&, QTextCharFormat const&)@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `QPointerEvent::point(long long)@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `QBitmap::~QBitmap()@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `QUrl::fromAce(QByteArray const&, QFlags<QUrl::AceProcessingOption>)@Qt_6'
Warning: linker: /usr/bin/ld: /usr/lib/x86_64-linux-gnu//libQt6Pas.so: undefined reference to `QUrl::toAce(QString const&, QFlags<QUrl::AceProcessingOption>)@Qt_6'

Title: Re: QT 6?
Post by: zeljko on November 14, 2022, 06:24:18 pm
Have you installed qt6-base-dev ? libQt6Pas should be build against Qt6-6.2.xx, not against 6.3.xx or superior.
Title: Re: QT 6?
Post by: El Salvador on November 14, 2022, 06:30:18 pm
I'm using libqt6pas built by dbannon (from deb package). Downloaded here https://github.com/davidbannon/libqt6pas/releases.
Title: Re: QT 6?
Post by: zeljko on November 14, 2022, 08:16:27 pm
What version of Qt6 libs is installed on your system ?
Title: Re: QT 6?
Post by: El Salvador on November 14, 2022, 08:52:04 pm
I'm using KDE Neon (base ubuntu 22.04). Qt6 libs are 6.2.4+dfsg-2ubuntu1 (see installed qt6 packages https://pastebin.com/2sb1ep2W ).
Title: Re: QT 6?
Post by: zeljko on November 14, 2022, 08:56:25 pm
It looks to me that dbannon built libQt6Pas against Qt6 6.3, so that's why it does not work. Hope he'll answer here soon.
This is suspicious in your errors: qt_version_tag@Qt_6.3
Title: Re: QT 6?
Post by: dbannon on November 14, 2022, 11:54:02 pm
Yes, I built libqt6pas against QT6 3.2, I did not realise there were still distros around using 6.2.4. Sorry, I really should have thought about that a bit better.

I will replace it asap, building now as I speak, will be a couple of hours...

Davo
Title: Re: QT 6?
Post by: El Salvador on November 15, 2022, 12:06:12 am
I will replace it asap, building now as I speak, will be a couple of hours...
Thank you so much! As soon as I can, I'll try again.
Title: Re: QT 6?
Post by: dbannon on November 15, 2022, 01:00:22 am
I will replace it asap, building now as I speak, will be a couple of hours...
Thank you so much! As soon as I can, I'll try again.

OK, all libraries updated. (Although the RPMs don't have a new package number, cannot workout how to do that in alien, sigh ...).

Sorry about that.

Davo
Title: Re: QT 6?
Post by: El Salvador on November 15, 2022, 08:34:10 am
Good, it works! Thank you!
Title: Re: QT 6?
Post by: AlexTP on November 17, 2022, 08:11:10 pm
Ppl, I added useful info 'Troubleshooting on compiling on Linux' to the Wiki
https://wiki.freepascal.org/Qt6_Interface
Title: Re: QT 6?
Post by: zeljko on November 17, 2022, 08:49:22 pm
Thanks, actually it should say that it's build against qt 6.2 LTS, since there's no api changes in minor versions, only bugfixes.
Title: Re: QT 6?
Post by: zeljko on November 17, 2022, 08:51:31 pm
Btw, just tested qt6 on macos, it works like a charm :)
Title: Re: QT 6?
Post by: theo on November 19, 2022, 12:24:59 pm
Quick test on 6.4.0 (OpenSUSE Tumbleweed).

Screenshot here: https://www.lazarusforum.de/viewtopic.php?p=131537#p131537

Thank you!  :-*
TinyPortal © 2005-2018