Author Topic: Qt6 Development  (Read 246325 times)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4823
  • Karma: +101/-1
    • View Profile
Re: Qt6
« Reply #75 on: November 18, 2022, 08:33:51 am »
I got the TLS plugin to compile with this patch,
Code: [Select]
diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h
index 146132b9..03944a84 100644
--- a/src/network/socket/qnativesocketengine_p.h
+++ b/src/network/socket/qnativesocketengine_p.h
@@ -100,6 +100,10 @@ typedef INT (WSAAPI *LPFN_WSASENDMSG)(SOCKET s, LPWSAMSG lpMsg, DWORD dwFlags,
 #  endif // !WSAID_WSASENDMSG
 #endif // Q_OS_WIN
 
+#ifdef __OS2__
+#define QT_NO_IPV6 1
+#endif
+
 union qt_sockaddr {
     sockaddr a;
     sockaddr_in a4;
diff --git a/src/plugins/tls/openssl/qdtls_openssl.cpp b/src/plugins/tls/openssl/qdtls_openssl.cpp
index 55a82f7f..2ab2231f 100644
--- a/src/plugins/tls/openssl/qdtls_openssl.cpp
+++ b/src/plugins/tls/openssl/qdtls_openssl.cpp
@@ -542,7 +542,11 @@ extern "C" long q_dgram_ctrl(BIO *bio, int cmd, long num, void *ptr)
         // using this address), but let's pretend a success.
         switch (dtls->remoteAddress.protocol()) {
         case QAbstractSocket::IPv6Protocol:
+#ifdef __OS2__
+            return sizeof(sockaddr_in);     
+#else
             return sizeof(sockaddr_in6);
+#endif
         case QAbstractSocket::IPv4Protocol:
             return sizeof(sockaddr_in);
         default:

Still seems wrong that IPv6 support seems to be detected.
Now the build is dying here,
Code: [Select]
file H:/tmp\ldconv_qminimalintegration_cpp_o_f40e6377332b19cbd0.obj(ldconv_qminimalintegration_cpp_o_f40e6377332b19cbd0.obj): undefined symbol __ZTV19QFontconfigDatabase
make[2]: *** [plugins/platforms/qminimal.dll] Error 1
make[1]: *** [src/plugins/platforms/minimal/CMakeFiles/QMinimalIntegrationPlugin.dir/all] Error 2

Hopefully don't need a newer fontconfig.
Bedtime here.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2099
  • Karma: +161/-0
    • View Profile
Re: Qt6
« Reply #76 on: November 18, 2022, 08:58:02 am »
I just checked in fixes for qos2clipboard.cpp and also the qminimal plugin

Edit: also for qos2
« Last Edit: November 18, 2022, 09:52:11 am by Paul Smedley »

TeLLie

  • Full Member
  • ***
  • Posts: 237
  • Karma: +12/-0
    • View Profile
Re: Qt6
« Reply #77 on: November 18, 2022, 02:21:15 pm »
Hi Paul & Dave

I now have use make and removed the ninja out of path.

G:\qt6\bin>qmake.exe --version
QMake version 3.1
Using Qt version 6.2.4 in /qt6/lib


But here it stops @ .......


AutoUic subprocess error
------------------------
The uic process failed to compile
  "SRC:/src/widgets/dialogs/qfiledialog.ui"
into
  "BIN:/src/widgets/Widgets_autogen/include/ui_qfiledialog.h"
included by
  "SRC:/src/widgets/dialogs/qfiledialog.cpp"
libuv process spawn failed: no such file or directory

Command
-------
G:/qt6-dev/bin/uic.exe -o G:/qt6-dev/src/widgets/Widgets_autogen/include/ui_qfiledialog.h G:/qt6-os2/src/widgets/dialogs/qfiledialog.ui

Output
------


make.exe[2]: *** [src/widgets/CMakeFiles/Widgets_autogen] Error 1
make.exe[1]: *** [src/widgets/CMakeFiles/Widgets_autogen.dir/all] Error 2
make.exe[1]: *** Waiting for unfinished jobs....
G:/qt6-os2/src/platformsupport/fbconvenience/qfbvthandler.cpp: In constructor 'QFbVtHandler::QFbVtHandler(QObject*)':
G

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4823
  • Karma: +101/-1
    • View Profile
Re: Qt6
« Reply #78 on: November 18, 2022, 04:16:12 pm »
Hi Tellie, try using BEGINLIBPATH to put the lib directory where the freshly built DLLs are in LIBPATH

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2099
  • Karma: +161/-0
    • View Profile
Re: Qt6
« Reply #79 on: November 18, 2022, 06:18:16 pm »
Tellies failure looks similar to mine, I'll almost wager he has a crash in popuplog.os2. I set a rebuild going with gcc 9.5.0 (vs 12.2.0) last night, will see how it goes once I get up. (Just got woken by a storm, but it's only 3:45am, so I'd better not go grab the laptop!)

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4823
  • Karma: +101/-1
    • View Profile
Re: Qt6
« Reply #80 on: November 18, 2022, 06:31:40 pm »
Yes, I'm now getting the same error. Still had to patch for the TLS plugin to compile here.

TeLLie

  • Full Member
  • ***
  • Posts: 237
  • Karma: +12/-0
    • View Profile
Re: Qt6
« Reply #81 on: November 18, 2022, 07:35:30 pm »
Hi
After set beginpath i see now this error:
I have notting in popup.log


G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp: In constructor 'QOffscreenIntegration::QOffscreenIntegration()':
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:102:30: error: expected type-specifier before 'QGenericUnixFontDatabase'
  102 |     m_fontDatabase.reset(new QGenericUnixFontDatabase());
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp: In member function 'virtual QAbstractEventDispatcher* QOffscreenIntegration::createEventDispatcher() const':
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:243:42: error: 'QEventDispatcherOS2' was not declared in this scope
  243 |     return new QOffscreenEventDispatcher<QEventDispatcherOS2>();
      |                                          ^~~~~~~~~~~~~~~~~~~
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:243:61: error: template argument 1 is invalid
  243 |     return new QOffscreenEventDispatcher<QEventDispatcherOS2>();
      |                                                             ^
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp: In member function 'virtual const QFont* OffscreenTheme::font(QPlatformTheme::Font) const':
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:288:46: error: variable 'QFont systemFont' has initializer but incomplete type
  288 |         static QFont systemFont(QLatin1String("Sans Serif"), 9);
      |                                              ^
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:289:45: error: variable 'QFont fixedFont' has initializer but incomplete type
  289 |         static QFont fixedFont(QLatin1String("monospace"), 9);
      |                                             ^
In file included from G:/qt6-dev/include/QtCore/qscopedpointer.h:1,
                 from G:/qt6-os2/src/corelib/serialization/qdatastream.h:43,
                 from G:/qt6-dev/include/QtCore/qdatastream.h:1,
                 from G:/qt6-os2/src/corelib/kernel/qmetatype.h:52,
                 from G:/qt6-dev/include/QtCore/qmetatype.h:1,
                 from G:/qt6-os2/src/gui/kernel/qplatformscreen.h:53,
                 from G:/qt6-dev/include/QtGui/6.2.4/QtGui/qpa/qplatformscreen.h:1,
                 from G:/qt6-os2/src/gui/kernel/qplatformintegration.h:54,
                 from G:/qt6-dev/include/QtGui/6.2.4/QtGui/qpa/qplatformintegration.h:1,
                 from G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.h:43,
                 from G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:40:
G:/qt6-os2/src/corelib/tools/qscopedpointer.h: In instantiation of 'static void QScopedPointerDeleter<T>::cleanup(T*) [with T = QPlatformFontDatabase]':
G:/qt6-os2/src/corelib/tools/qscopedpointer.h:116:25:   required from 'QScopedPointer<T, Cleanup>::~QScopedPointer() [with T = QPlatformFontDatabase; Cleanup = QScopedPointerDeleter<QPlatformFontDatabase>]'
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:96:46:   required from here
G:/qt6-os2/src/corelib/tools/qscopedpointer.h:57:40: error: invalid application of 'sizeof' to incomplete type 'QPlatformFontDatabase'
   57 |         typedef char IsIncompleteType[ sizeof(T) ? 1 : -1 ];
      |                                        ^~~~~~~~~
G:/qt6-os2/src/corelib/tools/qscopedpointer.h:60:9: warning: possible problem detected in invocation of 'operator delete' [-Wdelete-incomplete]
   60 |         delete pointer;
      |         ^~~~~~~~~~~~~~

Not sure if this same as Paul mention before about fontconfig....

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2099
  • Karma: +161/-0
    • View Profile
Re: Qt6
« Reply #82 on: November 18, 2022, 09:29:09 pm »
Yes, I'm now getting the same error. Still had to patch for the TLS plugin to compile here.
Weird, no patching for the TLS plugin here.....

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2099
  • Karma: +161/-0
    • View Profile
Re: Qt6
« Reply #83 on: November 18, 2022, 09:31:14 pm »
Hey Tellie,

Hi
After set beginpath i see now this error:
I have notting in popup.log


G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp: In constructor 'QOffscreenIntegration::QOffscreenIntegration()':
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:102:30: error: expected type-specifier before 'QGenericUnixFontDatabase'
  102 |     m_fontDatabase.reset(new QGenericUnixFontDatabase());
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp: In member function 'virtual QAbstractEventDispatcher* QOffscreenIntegration::createEventDispatcher() const':
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:243:42: error: 'QEventDispatcherOS2' was not declared in this scope
  243 |     return new QOffscreenEventDispatcher<QEventDispatcherOS2>();
      |                                          ^~~~~~~~~~~~~~~~~~~
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:243:61: error: template argument 1 is invalid
  243 |     return new QOffscreenEventDispatcher<QEventDispatcherOS2>();
      |                                                             ^
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp: In member function 'virtual const QFont* OffscreenTheme::font(QPlatformTheme::Font) const':
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:288:46: error: variable 'QFont systemFont' has initializer but incomplete type
  288 |         static QFont systemFont(QLatin1String("Sans Serif"), 9);
      |                                              ^
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:289:45: error: variable 'QFont fixedFont' has initializer but incomplete type
  289 |         static QFont fixedFont(QLatin1String("monospace"), 9);
      |                                             ^
In file included from G:/qt6-dev/include/QtCore/qscopedpointer.h:1,
                 from G:/qt6-os2/src/corelib/serialization/qdatastream.h:43,
                 from G:/qt6-dev/include/QtCore/qdatastream.h:1,
                 from G:/qt6-os2/src/corelib/kernel/qmetatype.h:52,
                 from G:/qt6-dev/include/QtCore/qmetatype.h:1,
                 from G:/qt6-os2/src/gui/kernel/qplatformscreen.h:53,
                 from G:/qt6-dev/include/QtGui/6.2.4/QtGui/qpa/qplatformscreen.h:1,
                 from G:/qt6-os2/src/gui/kernel/qplatformintegration.h:54,
                 from G:/qt6-dev/include/QtGui/6.2.4/QtGui/qpa/qplatformintegration.h:1,
                 from G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.h:43,
                 from G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:40:
G:/qt6-os2/src/corelib/tools/qscopedpointer.h: In instantiation of 'static void QScopedPointerDeleter<T>::cleanup(T*) [with T = QPlatformFontDatabase]':
G:/qt6-os2/src/corelib/tools/qscopedpointer.h:116:25:   required from 'QScopedPointer<T, Cleanup>::~QScopedPointer() [with T = QPlatformFontDatabase; Cleanup = QScopedPointerDeleter<QPlatformFontDatabase>]'
G:/qt6-os2/src/plugins/platforms/offscreen/qoffscreenintegration.cpp:96:46:   required from here
G:/qt6-os2/src/corelib/tools/qscopedpointer.h:57:40: error: invalid application of 'sizeof' to incomplete type 'QPlatformFontDatabase'
   57 |         typedef char IsIncompleteType[ sizeof(T) ? 1 : -1 ];
      |                                        ^~~~~~~~~
G:/qt6-os2/src/corelib/tools/qscopedpointer.h:60:9: warning: possible problem detected in invocation of 'operator delete' [-Wdelete-incomplete]
   60 |         delete pointer;
      |         ^~~~~~~~~~~~~~

Not sure if this same as Paul mention before about fontconfig....

I think you're back to getting further than me now, so you'll have to either fix it yourself or wait for me to catch up :)

My GCC 9.5.0 build failed as I didn't clear cmakecache.txt - so it tried to compile with gcc 12 and link with gcc 9 libs, which not surprisingly failed :P

More later...

Edit: I just pushed a probable fix for this...
« Last Edit: November 18, 2022, 09:36:37 pm by Paul Smedley »

TeLLie

  • Full Member
  • ***
  • Posts: 237
  • Karma: +12/-0
    • View Profile
Re: Qt6
« Reply #84 on: November 18, 2022, 10:56:17 pm »
Hi

I had indeed use the fix you have pushed, i had the fix taken from qt5

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2099
  • Karma: +161/-0
    • View Profile
Re: Qt6
« Reply #85 on: November 18, 2022, 11:49:07 pm »
I'm now dying here:
Code: [Select]
[ 90%] Building CXX object src/printsupport/CMakeFiles/PrintSupport.dir/PrintSupport_autogen/mocs_compilation.cpp.o
In file included from U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/mocs_compilation.cpp:4:
U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp: In static member function 'static void QPrintDialog::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)':
U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:93:29: error: invalid use of incomplete type 'class QPrintDialogPrivate'
   93 |         case 1: _t->d_func()->_q_togglePageSetCombo((*reinterpret_cast< std::add_pointer_t<bool>>(_a[1]))); break;
      |                             ^~
In file included from U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:10,
                 from U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/mocs_compilation.cpp:4:
U:/dev/qtbase-everywhere-src-6.2.4/src/printsupport/dialogs/qprintdialog.h:51:7: note: forward declaration of 'class QPrintDialogPrivate'
   51 | class QPrintDialogPrivate;
      |       ^~~~~~~~~~~~~~~~~~~
In file included from U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/mocs_compilation.cpp:4:
U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:94:29: error: invalid use of incomplete type 'class QPrintDialogPrivate'
   94 |         case 2: _t->d_func()->_q_collapseOrExpandDialog(); break;
      |                             ^~
In file included from U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:10,
                 from U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/mocs_compilation.cpp:4:
U:/dev/qtbase-everywhere-src-6.2.4/src/printsupport/dialogs/qprintdialog.h:51:7: note: forward declaration of 'class QPrintDialogPrivate'
   51 | class QPrintDialogPrivate;
      |       ^~~~~~~~~~~~~~~~~~~
In file included from U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/mocs_compilation.cpp:4:
U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:95:29: error: invalid use of incomplete type 'class QPrintDialogPrivate'
   95 |         case 3: _t->d_func()->_q_checkFields(); break;
      |                             ^~
In file included from U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:10,
                 from U:/DEV/qtbase-everywhere-src-6.2.4/build/src/printsupport/PrintSupport_autogen/mocs_compilation.cpp:4:
U:/dev/qtbase-everywhere-src-6.2.4/src/printsupport/dialogs/qprintdialog.h:51:7: note: forward declaration of 'class QPrintDialogPrivate'
   51 | class QPrintDialogPrivate;
      |       ^~~~~~~~~~~~~~~~~~~
make[1]: *** [src/printsupport/CMakeFiles/PrintSupport.dir/PrintSupport_autogen/mocs_compilation.cpp.o] Error 1
make: *** [PrintSupport_autogen/mocs_compilation.cpp.o] Error 2

TeLLie

  • Full Member
  • ***
  • Posts: 237
  • Karma: +12/-0
    • View Profile
Re: Qt6
« Reply #86 on: November 19, 2022, 12:26:07 am »
Hihi

I get same error now to...

G:/qt6-dev/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:93:29: error: invalid use of incomplete type 'class QPrintDialogPrivate'
   93 |         case 1: _t->d_func()->_q_togglePageSetCombo((*reinterpret_cast< std::add_pointer_t<bool>>(_a[1]))); break;
      |                             ^~
In file included from G:/qt6-dev/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:10:
G:/qt6-os2/src/printsupport/dialogs/qprintdialog.h:51:7: note: forward declaration of 'class QPrintDialogPrivate'
   51 | class QPrintDialogPrivate;
      |       ^~~~~~~~~~~~~~~~~~~
G:/qt6-dev/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:94:29: error: invalid use of incomplete type 'class QPrintDialogPrivate'
   94 |         case 2: _t->d_func()->_q_collapseOrExpandDialog(); break;
      |                             ^~
G:/qt6-os2/src/printsupport/dialogs/qprintdialog.h:51:7: note: forward declaration of 'class QPrintDialogPrivate'
   51 | class QPrintDialogPrivate;
      |       ^~~~~~~~~~~~~~~~~~~
G:/qt6-dev/src/printsupport/PrintSupport_autogen/2NRMJ5X7RK/moc_qprintdialog.cpp:95:29: error: invalid use of incomplete type 'class QPrintDialogPrivate'
   95 |         case 3: _t->d_func()->_q_checkFields(); break;
      |                             ^~
G:/qt6-os2/src/printsupport/dialogs/qprintdialog.h:51:7: note: forward declaration of 'class QPrintDialogPrivate'


BTw...

the latest push you made about #include <QtEventDispatcherSupport/private/qos2guieventdispatcher_p.h>
I get here a error that it could not find file.....
If i change to #include <QtGui/Support/private/qos2guieventdispatcher_p.h>
Then it is ok

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2099
  • Karma: +161/-0
    • View Profile
Re: Qt6
« Reply #87 on: November 19, 2022, 01:10:48 am »
Fixed the src\plugins\platforms\offscreen\qoffscreenintegration.cpp issue, that's what I get for committing something untested :/

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4823
  • Karma: +101/-1
    • View Profile
Re: Qt6
« Reply #88 on: November 19, 2022, 04:33:06 am »
Yes, I'm now getting the same error. Still had to patch for the TLS plugin to compile here.
Weird, no patching for the TLS plugin here.....

Yea, I can't understand what is happening but for some reason it thinks I have IPv6 support.
I created a branch and committed it locally.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2099
  • Karma: +161/-0
    • View Profile
Re: Qt6
« Reply #89 on: November 19, 2022, 05:21:53 am »
I am so close... got to 92% complete and got a missing symbol from sqlite - so now switched to rpm sqlite3 rather than my local build.

I compiled a console helloworld and it works, tried a gui one, and i'm getting:
Code: [Select]
qt.qpa.plugin: Could not find the Qt platform plugin "os2" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Probably/hopefully as I haven't 'installed' it yet, so it can't find qos2.dll...