PureBasic Forum
https://www.purebasic.fr/english/

[5.72] Textgadget with QT subsystem does not wrap lines
https://www.purebasic.fr/english/viewtopic.php?f=23&t=75690
Page 1 of 1

Author:  Kukulkan [ Fri Jul 10, 2020 10:37 am ]
Post subject:  [5.72] Textgadget with QT subsystem does not wrap lines

Try this with standard subsystem (gtk) and qt subsystem.

Using GTK, the gadget looks good and wraps lines.
Using QT, it is all one line (not readable).

Image

Code:
EnableExplicit

If OpenWindow(0, 0, 0, 250, 200, "TextGadget Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  TextGadget(0, 0, 0,  250, 200, "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam"+
                                 "nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam"+
                                 " erat, sed diam voluptua. ")
  Repeat
    Define Event = WaitWindowEvent()
   
  Until Event = #PB_Event_CloseWindow
EndIf


I tried several workarounds using
Code:
QtScript(~"gadget(0).lineWrapMode = 1;")
QtScript(~"gadget(0).wordWrapMode = 1;")

But no success in any combination.

Also, vertical alignment is wrong. I expect it to be on top (as usual with PB on other platforms).

Author:  Kukulkan [ Fri Jul 10, 2020 11:14 am ]
Post subject:  Re: [5.72] Textgadget with QT subsystem does not wrap lines

I just partially solved it using
Code:
QtScript(~"gadget(0).alignment = 33"); -> Qt::AlignLeft + Qt::AlignTop in decimal
QtScript(~"gadget(0).wordWrap = 1")

This aligns it to the top and left and enables wordwrap.

Still a bug...

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/