Recent

Author Topic: QT5 : Caption form with <n>  (Read 2909 times)

Tdecnj

  • New Member
  • *
  • Posts: 13
QT5 : Caption form with <n>
« on: May 01, 2024, 02:23:41 pm »
Environment :    Lazarus 2.2.6 , x86-64_64-linux-qt5, FPC 3.2.2,
                        Ubuntu 22.04, KDE Plasma 5.24.7,
                        KDE Frameworks 5.98.0, Qt 5.15.3, X11,
                        libqt5pas-dev 2.6+2.0.8+dfsg-2 and libqt5pas1 2.6+2.0.8+dfsg-2

Hello,
I'm having a curious display problem with QT5. The problem is as follows: at random, the form title appears followed by <2>. For example, if at design, Caption contains 'Form1' the display will show "Form1<2>". This happens inside and outside the IDE, compiled with or without debugging. Changing caption (e.g. 'form1' or 'Main form') in the OnCreate event the <2> disappears, but if, still in the OnCreate event, I put 'Form1' back the <2> returns. Any idea what may be causing this issue?
Thanks.
See little project in attachment

PascalDragon

  • Hero Member
  • *****
  • Posts: 6035
  • Compiler Developer
Re: QT5 : Caption form with <n>
« Reply #1 on: May 07, 2024, 09:49:14 pm »
Any idea what may be causing this issue?

This is likely your window manager adding this suffix if it detects a window of the same process with the same title. Had noticed that on a Kubuntu a few weeks ago as well (independant of Lazarus, cause it was a C++ application at work using raw X11).

Bart

  • Hero Member
  • *****
  • Posts: 5575
    • Bart en Mariska's Webstek
Re: QT5 : Caption form with <n>
« Reply #2 on: May 07, 2024, 10:41:46 pm »
IIRC same on GTK2.

Bart

Zoran

  • Hero Member
  • *****
  • Posts: 1949
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: QT5 : Caption form with <n>
« Reply #3 on: May 07, 2024, 11:57:35 pm »
When debugging, in Lazarus designer you have forms with same names. Then window manager adds <2>.
Try to close Lazarus and start your application outside the IDE. Does it happen?
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

cdbc

  • Hero Member
  • *****
  • Posts: 2252
    • http://www.cdbc.dk
Re: QT5 : Caption form with <n>
« Reply #4 on: May 08, 2024, 12:15:30 am »
Hi
Quote
Try to close Lazarus and start your application outside the IDE. Does it happen?
Yes, I get that consistently on Qt5.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

Tdecnj

  • New Member
  • *
  • Posts: 13
Re: QT5 : Caption form with <n>
« Reply #5 on: May 09, 2024, 08:23:55 pm »
Hello,
Thanks for your interest.

-1 : PascalDragon and Zoran : No, it can occur on Form with unique name.
-2 : Zoran : It can occur from the ide or outside
-3 : yes the number is probably a counter. I have just run my application outside the ide the main form has <2> then this form
call a modal form  that showed with <3> (each form with different title). From the ide the result was main form without <2> and
modal form with <2>. BUT if I quit Lazarus and run my application <n> disappear so i am suspecting KDE...
-4 : When the caption's form is empty Lazarus Ide show "EDI Lazarus V2.2.6 -then application name<2>" in the title form.
Thanks again.

Zoran

  • Hero Member
  • *****
  • Posts: 1949
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: QT5 : Caption form with <n>
« Reply #6 on: May 09, 2024, 10:54:40 pm »
if I quit Lazarus and run my application <n> disappear

That was my point in the first place. When the project is open in the IDE, there is the form in the designer which has the same caption. It does not matter whether you start the application from the IDE or outside.

I think that it's just that the window manager you have does not allow the two forms to have the same name. Globally.
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

 

TinyPortal © 2005-2018