View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037894 | Lazarus CCR | Widgetset | public | 2020-10-09 06:18 | 2021-01-24 09:54 |
Reporter | David | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Platform | Linux | OS | U18.04 (Qt5.9) | ||
Summary | 0037894: RichMemo method GetStyleRange fails on Qt5 | ||||
Description | Under Qt5 the GetStyleRange method determines that every single char is a style 'block'. In qt5richmemo.pas, 0000260 class function TQtWSCustomRichMemo.GetStyleRange() appears to be missing a line, one that populates the rng array. The code uses an undocumented function QTextBlock_textFormatsCount(), implemented as cpp code in libQt5Pas and right next to that function is QTextBlock_textFormatsRanges() that looks like its associated and does in fact populate an array with appropriate data. So, still guessing, I added a line using that latter function and GetStyleRange now works as expected. Patch enclosed. | ||||
Tags | No tags attached. | ||||
Widgetset | QT5 | ||||
Attached Files |
|
|
RM_Qt5_GetStyleRange.patch (514 bytes)
--- qt5/qt5richmemo.pas 2020-10-09 14:30:38.748966866 +1100 +++ new/qt5richmemo.pas 2020-10-09 14:57:43.447733669 +1100 @@ -296,6 +296,8 @@ cnt := QTextBlock_textFormatsCount(qblck); SetLength(rng, cnt); if cnt>0 then begin + // populate rng with start and length data, implemented in libQt5Pas + QTextBlock_textFormatsRanges(qblck, PTextRangeArray(rng), cnt); // DRB blckofs := QTextBlock_position(qblck); textStart := textStart - blckofs; for i:=0 to cnt-1 do begin |