Recent

Author Topic: qt5 line spacing in TListView  (Read 2190 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
qt5 line spacing in TListView
« on: November 11, 2020, 10:35:25 am »
I am using TListView in an OwnerDraw mode and when I use Qt5, the lines of text are too close together vertically.  If I turn off the OwnerDraw, its not as bad but still a bit too close.

Is there a way to adjust the clearance ?

In both images below, the control to left is not ownerdrawn, one to the right is.
In the first image, GTK2, spacing is about the same and about right, IMHO.
In the image below that, Qt5,  not a huge difference but its quite noticeable !

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 2791
    • tomboy-ng, a rewrite of the classic Tomboy
Re: qt5 line spacing in TListView
« Reply #1 on: November 14, 2020, 12:44:09 pm »
I am still concerned about this issue. 

If I increase the font used by Qt5 by about 2 or 4 points, it looks heaps better. So -
Code: Pascal  [Select][+][-]
  1.     ...
  2.     {$ifdef LCLQT5}
  3.     fd := GetFontData( SearchForm.Font.Handle );
  4.     ListViewNotes.Font.Height := round((fd.Height * 72 / SearchForm.Font.PixelsPerInch)) + 4;
  5.     {$endif}    
  6.     ....

(SearchForm being the form we are working it at the time, fd is TFontData).

But I really don't why this is necessary, and don't think it should be.

Signed,
Disgruntled of Mayfair.


Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018