Forum > Unix

Fedora Richmemo and QT5

(1/1)

OH1KH:
Hi !

I found from lazarus-ccr-svn-6262 a richmemo that had QT5 included.
I tried to use it with my program that works ok with gtk2 widgetset. When compiled with QT5 widgetset I have no errors at compile time and no errors at runtime.

It is just so that I do not get any text any more with QT5 widgetset. Sampe code that was along richmemo that had QT5 folder works ok. (richmemo-qt5/samples/testsimple)
It is how ever different from my code that is direct copy from richmemo wiki's one:

"If you need mixed coloring then this is an example that will add a new line with several different colored words (tested on Windows):"
It works with gtk2, but not with QT5 widgetset.

Could someone else confirm this. I'm always suspecting errors in my Laz-setups.

zeljko:
Does it work with Qt4 widgetset ?

OH1KH:
I have only QT5 and do not want to downgrade

Thaddy:
QT5 support is fairly recent. (And I don't use it) But if you have a small project that reproduces it, you can file a bugreport.

OH1KH:
It seems that SelStart and SelLength can be set but when text is assigned to SelText its causes:

QTextCursor::setPosition: Position '11' out of range

Tried with different order of those 3 , but SelText assign causes the error.



--- Code: Pascal  window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- procedure AddColorStr(s: string; const col: TColor = clBlack; const NewLine: boolean = true);      begin        with WsjtxMemo do        begin          if NewLine then          begin            writeln('---------------------print NL-----------------');            Lines.Add('');            Lines.Delete(Lines.Count - 1); // avoid double line spacing          end;          writeln('---------------------print text-----------------');          writeln('textlen',Length(s));          SelStart := length(Text);          writeln('selstart ',SelStart);          SelLength := length(s);          writeln('sellen ',SelLength);          SelText   := s;          writeln('seltext ',s);          SetRangeColor(SelStart, SelLength, col);        end;      end;             
I wonder why there is not a function that you could add one char (or string) to existing text without CR+NL.
And if that exist why just change first FontParameters  to desired color and then just add wanted char(s) to end of the existing text (that then appeared with new selected color)
Why this coloring has to go via add text, select it, color it like in wiki's example.

Navigation

[0] Message Index

Go to full version