View Issue Details

IDProjectCategoryView StatusLast Update
0038394LazarusLCLpublic2021-04-04 17:02
ReporterDavid Assigned ToZeljan Rikalo  
Status resolvedResolutionno change required 
Product Version2.1 (SVN) 
Summary0038394: QT5: ListView ignores vertical scroll bar when calculating column width.
DescriptionWhen List View has a vertical Scroll bar, the right hand side of the control is obscured. Both the cells and column header are affected. While its possible to pad out the text with trailing spaces, the Sort Indicator pop up on the far right of the column header is always affected.
Steps To ReproduceThe problem is most easily demonstrated using Sort Indicators but thats not the extent of the problem. If the text in the cells occupies the whole cell, for example if the right hand column's width is auto adjusted, several characters are hidden.

To demo using Sort Indicator, drop a ListView on a form, set some values in FormCreate() -

    ListView1.AutoSortIndicator := True;
    ListView1.Column[0].SortIndicator := siDescending; // siDescending; siAscending
    ListView1.SortColumn := 0;
    ListView1.Column[0].Caption:= 'A nice list';
    ListView1.SortType:= stBoth;
    ListView1.ViewStyle:= vsReport;
    ListView1.ReadOnly := True;
    ListView1.ScrollBars := ssVertical;

(Most of that is to get sort indicator displayed ...)

Run it. See the Sort Indicator in column header, right hand side ? Remove the scroll bar and you can see all of the Sort Indicator.

As I mentioned, this problem affects text in the control's cells as well. Most easly demo'ed with multiple columns and the right hand one set to auto width.
TagsNo tags attached.
Fixed in Revision
Attached Files



2021-01-24 12:23

reporter   ~0128550

Sorry, I have messed up here, I can only demonstrate this on Qt5, not GTK2. I think I must have had my test app mapped to QT5 even in GTK2 mode ???

So, seems its a QT5 issue only.

And to demo it, you need to add a column using the Object Inspector and set AutoWidthLastColumn to true.

Sorry for sloppy report.

Juha Manninen

2021-01-25 14:11

developer   ~0128585

I updated the widgetset.

Zeljan Rikalo

2021-03-01 12:29

developer   ~0129273

Sorry, but I don't understand this issue. Have you setted up AutoWidthLastColumn := True ? It works ok here, lazarus r64708, fpc-3.2.0, KDE Plasma on LinuxMint 20.
Also, please attach example project.


2021-03-13 08:22

reporter   ~0129619

Yes, making a simple demo is always good for understanding an issue. Wish I had made the demo before I submitted the issue !

I found that its not the case that the width of the scroll bar is ignored, its just that if you adjust column width immediately after the scroll bar appears, its not allowed for. Wait a while and you get the the right result. A call to Application.ProcessMessages just after populating the ListView and before adjusting its columns works fine. I expect that same trick will work in my application.

So, this is a false report, sorry, please close it. I don't think the need for the delay is a reportable issue, just something we allow for.

(And sorry I took so long to come back and look at this ticket, busy ...)


Zeljan Rikalo

2021-04-04 17:02

developer   ~0130081

Resolved as "no change required", please close.

Issue History

Date Modified Username Field Change
2021-01-24 09:08 David New Issue
2021-01-24 12:23 David Note Added: 0128550
2021-01-25 14:11 Juha Manninen Summary ListView does not allow for vertical scroll bar when calc column width. => QT5: ListView does not allow for vertical scroll bar when calc column width.
2021-01-25 14:11 Juha Manninen Additional Information Updated View Revisions
2021-01-25 14:11 Juha Manninen LazTarget => -
2021-01-25 14:11 Juha Manninen Widgetset GTK 2 => QT5
2021-01-25 14:11 Juha Manninen Note Added: 0128585
2021-01-25 14:15 Juha Manninen Summary QT5: ListView does not allow for vertical scroll bar when calc column width. => QT5: ListView ignores vertical scroll bar when calculating column width.
2021-01-25 14:15 Juha Manninen Widgetset QT5 => QT5
2021-02-01 22:58 Zeljan Rikalo Assigned To => Zeljan Rikalo
2021-02-01 22:58 Zeljan Rikalo Status new => assigned
2021-03-01 12:29 Zeljan Rikalo Status assigned => feedback
2021-03-01 12:29 Zeljan Rikalo Note Added: 0129273
2021-03-13 08:22 David Note Added: 0129619
2021-03-13 08:22 David Status feedback => assigned
2021-04-04 17:02 Zeljan Rikalo Status assigned => resolved
2021-04-04 17:02 Zeljan Rikalo Resolution open => no change required
2021-04-04 17:02 Zeljan Rikalo Widgetset QT5 => QT5
2021-04-04 17:02 Zeljan Rikalo Note Added: 0130081