I would really like some advice here. I have been chasing a bug in RichMemo and have come up against what appears a problem in the bindings. Or the libraries them selves ? Both very unlikely but ...
Qt provides the QtextEdit widget, RichMemo does use it but I am pretty sure my problem is in the Qt system, not Richmemo. QtextEdit has members that returns information about a specific char in the control's text. These methods are exposed to us FPC/Lazarus users as things like QTextEdit_textBackgroundColor(). All good.
If you open the control, for example in a RichMemo and type some text in or append a string, the control gives it sensible default colours, font etc. But if you try and find out what those settings are, bad luck, you get blank font, zero points and both foreground and background are black.
But if you manually set (eg) the colours, and then read them, you get what you would expect. So, the only way to read the settings in a control like this is to watch every key stroke and set its settings as the user types ! Thats not going to work !
Very simple demo attached, it has a RichMemo, it appends some text, tries to read the colours of that text. And fails. Then it sets some of that text's colours and tries again, it works.
Now, the QTextEdit_textBackgroundColor() method is defined in libQt5Pas, it just sets a passed var to the value returned by a call to QTextEdit.textBackgroundColor(), a function that exists, I believe in the Qt5 runtime libraries. Can anyone suggest how I can debug that side of things ?
Davo