Any suggestions?
Zoran
On Wednesday, February 19, 2014 12:17:49 PM UTC+1, Zoran Sibinovic wrote:Hi,
I have made
REQUEST HB_CODEPAGE_SR646
...SET( _SET_CODEPAGE, "SR646" )
...
oTextBox := QTextEdit( oDlg )oTextBox:setfont( QFont( "Courier New", 9 ))oTextBox:Move( 685, 200 )oTextBox:Resize( 160,250 )
oTextBox:setText( "Text @{}[]^" )oTextBox:show()
...
now, while showing "Text @{}[]^", the text is displayed as it have to: "Text "ŽšćŠĆČ` , but if I want to continue to insert/input text directly, the special characters are not recognized anymore.
HI Luigi,
I have tried all of your suggestions, some before the post, some after, plaintext methods too, but without success.
You use ITWIN, I can use SRWIN or HRWIN and can work, but if I try to use a non-unicode codepage like SR646 the problem emerges.
Anyway, if you like, can you build and run included file and see what happens?
Hi Luigi,
sorry for not answered till now.
I had tried today your code and it is ok, and it works for the examples I already mentioned, but not in case of non-unicode codepages.
As using SR646 is the same as you use ex. IT437 or IT850 (non-unicode) but not ITWIN (unicode).
In the mentime I found the reason of why my spec chars are not correctly displayed.
Since this happens using Qlineedit, Qtextedit. memoedit etc., but, not in ex. hbqtbrowse Qlineedit that is used for the cell editing (:editcell()).
I came to the conclusion:
:editcell() had a control for every pressed sign/character that's analize the character, after which insert it or not in the text and refresh the screen text line.In the other hand Qlineedit, Qtextedit. memoedit in their base use, had no control for individual characters so the text line is not refreshed.
In conclusion, the solution for the non-unicode or utf chatacters to be displayed correctly in Qlineedit. Qtextedit. memoedit, etc objects is to find a way to refresh them on every entered character. In that case the CP translation will be triggered.
Qt (not QtContribs or HbQt) for its internal manage only unicode; when user set QLocale there are translation for input or output. But we are using a binding (HbQt).
When I use (ie) :setText( "luigi" ) or cVar := :text() is there something between my program and Qt? Yes, HbQt. in what way send or receive text to the real Qt object? As is or ?
I haven't idea .... sorry.
Harbour use UNICODE - Qt use UNICODE all works fine
Harbour don't use UNICODE - Qt doesn't know. Can you use (ie) hb_Translate( ...)? :setText ( hb_Translate( .... ) ) ?\
What codePage HbQtBrowse e/o HbQtWidgets (LineEdit) are still using? SR646, IT437 or ITWIN, SRWIN?\
Now it's my nightmare.....Thanks for answeringZoran
--
You received this message because you are subscribed to the Google Groups "QtContribs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qtcontribs+...@googlegroups.com.
To post to this group, send email to qtcon...@googlegroups.com.
Visit this group at http://groups.google.com/group/qtcontribs.
For more options, visit https://groups.google.com/groups/opt_out.
The solution you found Luigi already found in the past since I remember he used in his code... but it is an "hack".. harbour is used to do the conversion from UTF8 to codepage and then from codepage to UTF8 with :setText().
Sure, that's a hack, but is acceptable when you have some deadline and not the time to make a comprehensive apps change to make it non a hack.
In the other hand, the problem appears also in validatr.prg in the@ 9, 02, 12, 30 GET cNotes MEMOEDIT CONTROL oWnd:editNotes COLOR "N/rgb(255,255,230)" WHEN cText == "DEF" VALID "Harbour" $ cNotes
when you enter in the edit mode.So I suppose that Pritpal, when back, will take note of this to make it a non-hack.
I've tried with all the qtextedit signals and tried to put some switches to avoid the recursivity, but the thing is not working.The last for today will be to try :keypressevent()