Lazarus 1.9 trunk Qt4 and Qt5 interface (screenshots)

It turns out that the package installer gives an important hint where to find and place the config files for fpc:

“copy fpc settings (fpc.cfg, fppkg.cfg, fppkg (that’s a folder I believe)) from /boot/system/data/fpc to /etc”

That indeed does the trick (I tested 64bit haiku), the only thing missing then is de debugger which I rarely need anyway ;-).
Tried on a nightly around the one s40in posted the 64 bit builds in his repository, and that works.
Switching back to a recent nightly and retrying there…

Update: Works. Trying to compile the company software…

Update2:

So,

In the meantime the software compiles, and links. That’s more than currently on Windows.
Running the app is not possible yet though, I get following error with a failed solution after that:

~/gcmain_lazarus/30comp/exe> GCControl
qt.qpa.plugin: Could not find the Qt platform plugin “haiku” in “”
100% repochecksum-1 [65 bytes]
Validating checksum for Haiku…done.
100% repochecksum-1 [64 bytes]
Validating checksum for HaikuPorts…done.
qthaikuplugins-5.14.0.9-1 from repository system is already installed.
Nothing to do.

Hmm… Stuck for now. Qt4 does not link yet, maybe I’ll try that instead (used Qt4 before succesfully).

Anyone know a fix for above error by any chance?

Update3:
OK, Since I am also using Qt on Windows I have a qt.conf file in my exe folder. That misleads my exe on Haiku: simply delete it and the app launches. :sunglasses: Still looking ugly, so I need to search now in my sourcecode to find Haiku specifics.
One thing I encountered is that units need exactly correctly upper/lowercase chars in their names compared to the referencing units (in the ‘uses’ clause). Which BTW does not apply in Linux…

Update 4:
We have a lift-off: application is fully up and running!. Wow… :sunglasses:

4 Likes

if you can write your walktrough i’m sure many will be helped by it…

Screenshot please :slight_smile:

I’ll post some screenshots asap. First I am updating a few posix files needed for USB/Serial ports as that’s still not upto par in FPC, and so does not work… Would be cool if someone could push that upstream (or whatever it’s called to get it updated in the sources there :wink: )

Update: I’ll post a zip file on my website with a link here with modified SynaSer, the termios updates and a small readme. With these updates you can use Synaser serial/USB port support on Windows, Linux and Haiku (ARM/x86/x64).

Here is the download link for SynaSer with termios updates for current Haiku:
http://www.rudolfs-place.nl/Haiku/Downloads/SerPort_updates_FPC_RudolfCornelissen.zip

2 Likes

In the meantime I was busy bug-hunting with my Lazarus application on Haiku. Looks like everything is up and running, a few Haiku-Only ‘artifacts’ remain: these do not exist on Linux Qt5 and Windows Win32 Widgeset and Qt5, just on Haiku:

  • I am using UniqueInstanceRaw to make sure my app can be launched only as one instance. This component works by creating a network connection to itself (didn’t look at the finer details yet). This works nicely, but fails if the app crashes: when I kill the app in this case, the network connection is not reset by the app_server / system, so remains blocking the port. Which is why I cannot restart my software without a Haiku restart (network restart only does not solve this situation). The old instance is still reported ‘running’.

  • Exiting the application normally when I am running a data graph simulation at high speed (a new image each 20mS or even faster) is a problem: looks like I deadlock. If I let the simulation run real slow (say slower than a few images per second I can exit the app. If I first stop the simulation I can exit the app as well. This simulation is run by a FPTimer BTW. if I play around with the simulation speed: at approx 20mS I can exit the app if it’s not fullscreen (just drag it a few pixels, that’s enough). At fullscreen I can once exit the app, but second try fails (I have a quit confirmation dialog which is called in event OnCloseQuery, so the first time I cancel the quit, and then the second time around the app hangs. If I go to 1mSec interval or there about, I can never quit the app, fullscreen or small windowed: app hangs.

With hangs I mean the quit confirmation dialog never shows, simulations comes to sudden stop, app does not respond at all anymore.

Of course the problem I am describing here is -not- happening on Linux or Windows, with Qt or Win32.

The above two things are ‘minor’ problems, but would be cool if these could be solved somehow. I am guessing these should be solved inside Haiku or maybe FPC/Lazarus, but not in my app. Seeing the multiplatform behaviour differences.

The third problem is a big one though, which is a real problem for me:

  • If you have a Form, with on that form a TPanel, with on that panel a TLabel: the label will never be visible. Not at design time, not at run time. It does not matter one bit if you change panel or label properties like enabled/disabled or so. Design time I can see that the label exists, the dragging dashed line is there with the correct position and size: but no text. If I look at the form text-wise, all seems in order. If I move the label graphically by dragging, or textwise by cutting and pasting the label -outside- the panel: it suddenly appears. Dragging or cut/pasting back: gone.

This problem also does not exist on any other platform or widgeset: just on Haiku (only tested Qt5 there.)
So this problem does not exist (tested):
Linux ARM Qt4, gtk2
Linux x86 Qt4, gtk2
Linux x64 Qt5, gtk2
Windows x86 Qt4, Qt5, Win32
Windos x64 Qt4, Qt5, Win32.

This label thing is nasty because a user is unable to read it and so does not know what’s going on in the app.

Update: I just looked at my posted cross-compiled screenshots from Windows x64: the labels are visible there, so this must be a Lazarus/LCL fault when running on Haiku (only)…

Oh yes: (fourth problem):

  • Printer4Lazarus doesn’t work as well: PrinterDialog and PrinterSetupDialog both don’t show.
    If on Qt (4,5) I directly call these items in Qt (via the pascal bindings) instead of the Delphi way, then these dialogs show, and work: though no printer shows up, just the Qt PDF printer (and works).
    On my Haiku system I have a PCL5 printerdriver for network (HP), and from StyledEdit it indeed prints correctly.

The last thing I need to test is trying to setup a network TCP/IP server connection with a few clients. While Indy10 succesfully compiles (after I add the in haiku’s files in FTP/Lazarus missing IPV6 defines), it does not work. It also does not work on ARM linux, but x64 and x86 Intel Linux/Windows is OK.

Since UniqueInstance is able to setup a network interface it must somehow be possible for me to do that. I guess I’ll look first at Indy, then at Synaser (also has a network component, which I did not add yet btw), and then at how UniqueInstance works, or vice versa.

All in all I think using Lazarus on Haiku x64 is a reasonably success, again (I also tested pre-Beta1, see earlier in this discussion, back then though using cross-compiling from Windows x64). The Haiku version I tested now is href54026.

If the debugger would also work in Lazarus, and the font issues in the editor are fixed, along with at least the TLabel on TPanel issue, I think it’s perfect (enough), even for day to day use.

I hope I can place a few screenshots here in the coming days. Stay tuned.

2 Likes

This seems to work for me:

1 Like

Wow, Glad I shared this info! Thanks for your response :slight_smile: Didn’t think of creating a new TPanel on my form, was just fiddling with the existing one since it -must- be OK.
I got it: there’s indeed a fault, it’s in TPanel: in your empty app, try BorderStyle bsSingle?
In my case switching between bsNone and bsSingle I can turn the label texts visible/invisible.
Hmmm… Now I want a fix :wink:

It’s a bug in Haiku Qt5 style https://github.com/threedeyes/qthaikuplugins/blob/master/styles/qthaikustyle/haiku/qhaikustyle.cpp

You can workaround it for now by starting Lazarus with another style:
/system/apps/lazarus/lazarus -style fusion

24

2 Likes

Unfortunately that is not the case. While I see the texts design-time, I still don’t see them in my compiled app. Would you have a workaround for that?
BTW: So is Three3Eyes aware of this bug or should it still be reported? Can you tell me more about the bug specifics? Can’t I just modify that file and recompile? It’s part of the bindings? Thanks!

OK, I have to start my app with that same command line option :wink: Still, I’m curious to more info :slight_smile:

Yes, he’s aware of the bug as it was him to suggest that this bug is in the style :slight_smile:
You can file a ticket so it’s not forgotten here https://github.com/threedeyes/qthaikuplugins/issues

1 Like

Compiled style is in /system/add-ons/Qt5/styles/libqhaikustyle.so
which is part of qthaikuplugins-5.14.0.9-1-x86_64.hpkg

You can install haikuporter and build this package like this:
haikuporter -S -j2 --no-source-packages --get-dependencies qthaikuplugins

This is Haiku bug and it should be reported to dev.haiku-os.org if not already. All owned resources should be freed after process termination.

app_server is unrelated to network, it is responsible for graphics user interface and input dispatching (similar to X11 or Wayland in Linux or win32k.sys in Windows).

Done:

A quick search just now did nor reveal an existing ticket to me. I could create a ticket in which I just describe the Lazarus component to use to demonstrate this I guess (I guess I first need to create an empty app with just this component added, and simulate a crash by just killing the app)… any further thoughts about this?

Provide minimal test program in C++ that reproduce problem if possible, if not provide link to source that cause problem.

OK, I understand. Well, I am not going to switch to C/C++ at this time, I’m on Lazarus/FPC now, and I must keep this work-related for now. I need to switch to other platforms and other functions again asap unfortunately.

This is fine.

Thanks, I’ll have a look but apparantly I need to reinstall Haiku as switching Appearances to s40in’s components permanently makes most system (prefs) apps crash (100% CPU load). BTW the look and feel did change, and also fixed the invisible Labels issue without having to use a command line option for that…

Update: no reinstall needed, just removed the home/config/settings/appserver (or so) appearance settings and reboot. Pfew. One of the nice things about Haiku :slight_smile:

Update2: As an app workaround on Haiku I now simply (in code) set BorderStyle to bsNone, and use BevelInner = bvLowered, and BevelOuter = bvRaised. Looks more or less the same and I don’t need command line arguments to ‘get the job done’. Of course for Lazarus itself the command line trick still applies. The app is now useable in a reasonable decent way (apart from network support yet). Nice! :slight_smile:

Oh, and I just saw that also the TPanel.Caption text is not visible, so is part of the ‘TLabel’ bug.

1 Like

Is the debug at source level with GDB solved?

THX

Not that I know of…?