Author Topic: Qt6 Application Testing  (Read 262385 times)

David McKenna

  • Hero Member
  • *****
  • Posts: 807
  • Karma: +25/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #420 on: June 24, 2023, 02:37:39 am »
 Thanks Paul!

  The QMLCharts stuff does indeed work now. The 2 biggest problems I see now in the examples are the 'module 'shared' is not installed' message, and many errors like this:

'Button' is not a type
'TextField' is not a type
'Label' is not a type
'Drawer' is not a type etc. many others 'Something' is not a type - in the quick and quickcontrols directories.

 Of course no Multimedia examples work because no OS/2 backend for that.

 Do you know anything about setting up dbus on OS/2? I have it installed and I can start the daemon, but the dbus examples all say it can't connect to the session dbus - dbus is probably not configured correctly, but at this point I don't have a clue...

Regards,


Paul Smedley

  • Hero Member
  • *****
  • Posts: 2249
  • Karma: +171/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #421 on: June 24, 2023, 03:11:10 am »
Thanks David.... I think the "shared" error is coming from the following in (for example) animations.qml:
Code: [Select]
import shared as Examples
I need to work out what this is trying to do...

re: the 'is not a type' errors - right now I have no idea what's causing those :(

re: dbus - I thought in recent qt6-base builds I had disabled dbus - which may explain why it doesn't work - sorry, I haven't tried it at all.

re: qtmultimedia - it's on my list to try make a libkai backend - but tbh it may be beyond me - it requires actual coding not just hacking things until they work :P

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2249
  • Karma: +171/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #422 on: June 24, 2023, 03:19:11 am »
Thanks David.... I think the "shared" error is coming from the following in (for example) animations.qml:
Code: [Select]
import shared as Examples
I need to work out what this is trying to do...

OK it's *something* to do with loading the DLL in u:\qt6\examples\quick\animation\examples\quick\animation\shared - seems to try and load it as shared will need to think about this....

David McKenna

  • Hero Member
  • *****
  • Posts: 807
  • Karma: +25/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #423 on: June 25, 2023, 04:21:15 pm »
Hey Paul,

  Poking around today in the 'quick' examples directory, I notice that all the examples that give a 'module 'XXXXX' is not installed' error have a directory called 'XXXXX' at the end of a chain of directories, and in that directory is a DLL and a file called 'qmldir'. It looks like the 'qmldir' file contains info about what DLL to use, but somehow the message isn't getting thru to the program. Possibly not using the correct shortened name, or not using *.DLL or something? Somehow that 'qmldir' file is the key.

 I also notice that the examples that have the '... is not a type' error - if you run them over and over, the type listed is different each time. The error usually looks something like this:

QQmlApplicationEngine failed to load component
qrc:/contactlist.qml:54:1: ApplicationWindow is not a type

  I can't find a 'contactlist.qml' file anywhere on my system - maybe just a case of missing files?

Regards,


Paul Smedley

  • Hero Member
  • *****
  • Posts: 2249
  • Karma: +171/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #424 on: June 26, 2023, 10:55:23 am »
  Poking around today in the 'quick' examples directory, I notice that all the examples that give a 'module 'XXXXX' is not installed' error have a directory called 'XXXXX' at the end of a chain of directories, and in that directory is a DLL and a file called 'qmldir'. It looks like the 'qmldir' file contains info about what DLL to use, but somehow the message isn't getting thru to the program. Possibly not using the correct shortened name, or not using *.DLL or something? Somehow that 'qmldir' file is the key.
Yeah it's related to that qmldir somehow. The bit I can't work out is why the reference is 'shared' I may need to run os2trace or something to understand what filepath it's trying to open and then work out why it's failing. Hmmm had a lightbulb moment as I was writing this.... it looks like a packaging issue.....

The file in (for example):
u:\qt6\examples\quick\animation\examples\quick\animation\shared\* should be in:
u:\qt6\examples\quick\animation\shared\* - then there is the issue of ensuring the names in qmldir match...

Still not *quite* working....

I also notice that the examples that have the '... is not a type' error - if you run them over and over, the type listed is different each time. The error usually looks something like this:

QQmlApplicationEngine failed to load component
qrc:/contactlist.qml:54:1: ApplicationWindow is not a type

  I can't find a 'contactlist.qml' file anywhere on my system - maybe just a case of missing files?

I believe the qml file is compiled into the executable..... so this isn't it :)

Cheers,

Paul
« Last Edit: June 26, 2023, 10:57:15 am by Paul Smedley »

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 361
  • Karma: +29/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #425 on: June 26, 2023, 12:05:39 pm »
My understanding of QML loading is, that QML files get compiled into the executable, if you reference them via resource files. But you can also reference them from the file system.

David McKenna

  • Hero Member
  • *****
  • Posts: 807
  • Karma: +25/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #426 on: June 26, 2023, 01:07:30 pm »
Hey Paul!

The file in (for example):
u:\qt6\examples\quick\animation\examples\quick\animation\shared\* should be in:
u:\qt6\examples\quick\animation\shared\* - then there is the issue of ensuring the names in qmldir match...

 That's it! I moved the 'Shared' directory in \examples\quick\animation\examples\quick\animation to \examples\quick\animation, and now it works!
Tried a different one that didn't work at first, but when I changed the 'Optional Plugin' directive in 'qmldir' to match the shortened DLL name, that one started working too. So the quick stuff really does work.... need to check the '...is not a type' errors for something similar.

Regards,
« Last Edit: June 26, 2023, 11:36:38 pm by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2249
  • Karma: +171/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #427 on: June 27, 2023, 04:03:49 am »
I'm guessing that somewhere in either cmake or Qt's cmake files, there is some needed code for relative/absolute paths that is missing support for drive letters - hence the path mangling.... I had a bit of a hunt last night to no avail - will try again when I get a minute.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2249
  • Karma: +171/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #428 on: July 05, 2023, 11:36:24 am »
OK so I was wrong about relative/absolute paths.

For some reason, in the examples dir, the following is being set:
set(CMAKE_INSTALL_PREFIX "/qt6/examples/quick/animation")

then later...
file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/examples/quick/animation/shared" TYPE FILE FILES "U:/dev/qt6-declarative-os2-6.3.x/build/examples/quick/animation/shared/qmldir")

so INSTALL_DESTINATION is set to /qt6/examples/quick/animation + /examples/quick/animation/shared = /qt6/examples/quick/animation/examples/quick/animation/shared

I believe CMAKE_INSTALL_PREFIX should just be /qt6 and manually changing it to this installs into the right place...

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2249
  • Karma: +171/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #429 on: July 05, 2023, 11:38:40 am »
I believe CMAKE_INSTALL_PREFIX should just be /qt6 and manually changing it to this installs into the right place...

Nope, cos then animationexample gets installed into /qt6..... hmmmmm

Lars

  • Hero Member
  • *****
  • Posts: 1353
  • Karma: +69/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #430 on: July 05, 2023, 07:34:13 pm »
and what happens if you adjust INSTALL_DESTINATION to strip to ${CMAKE_INSTALL_PREFIX}/shared only?
« Last Edit: July 05, 2023, 10:28:05 pm by Lars »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2249
  • Karma: +171/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #431 on: July 06, 2023, 10:55:17 am »
Hey Lars,

and what happens if you adjust INSTALL_DESTINATION to strip to ${CMAKE_INSTALL_PREFIX}/shared only?

Yeah I'm sure that would work too. Interestingly, I checked cmake_install.txt from a linux build of qtdeclarative-6.5.1, which has:
Code: [Select]
# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX "/usr/local/Qt-6.5.1/examples/quick/animation")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

&

Code: [Select]
if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/examples/quick/animation/shared" TYPE FILE FILES "/home/psmedley/qtdeclarative-everywhere-src-6.5.1/build/examples/quick/animation/shared/qmldir")
endif()

So i'm not sure how it works on linux either - there must be something I'm missing.....

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2249
  • Karma: +171/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #432 on: July 09, 2023, 12:01:53 am »
So.. or those with issues with special characters - I built a new qos2.dll which logs the keypresses - https://smedley.id.au/tmp/qos2-20230709.zip Backup the old \qt6\plugins\platform\qos2.dll and replace with this one.

Load a qt app (like tea) - each key press will log to the console, ie:
Code: [Select]
chm.chr = 0x24
chm.chr = 0x24
(for some reason, each keypress is logged twice).

Curious if anything shows up for the keycodes that don't appear in the app - like the Euro. Also, any tips on entering a Euro on a US English keyboard?

Remy

  • Hero Member
  • *****
  • Posts: 736
  • Karma: +10/-1
    • View Profile
Re: Qt6 Application Testing
« Reply #433 on: July 09, 2023, 12:24:29 am »
May be you can try:
"type the Euro sign by holding Alt and typing 0128 in the numerical pads on the right side of your keyboard"

David McKenna

  • Hero Member
  • *****
  • Posts: 807
  • Karma: +25/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #434 on: July 09, 2023, 01:25:00 am »
 If you open AE.exe and type <alt>0213, you will get a euro symbol (it also shows in the 'Character Map' utility). But if you do it in FeatherNotes, you get nothing. So it seems there is some disconnect between the OS/2 850 codepage and whatever FeatherNotes expects... or maybe FeatherNotes needs more directives...

Regards,

EDIT: In the 'Character Map' utility, if you choose the 'Unicode (Plane 0)' display, there is no euro symbol offered that I can see. WTF? Does OS/2 not offer a euro symbol in Unicode!??
« Last Edit: July 09, 2023, 01:36:55 am by David McKenna »