mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 09:19:32 +02:00
Qt,Qt5,Qt6: fixed vertical alignment of text.issue #41465
(cherry picked from commit 45eabe826d
)
Co-authored-by: zeljan1 <zeljko@holobit.hr>
This commit is contained in:
parent
6b6dbd3e81
commit
b6f6c4c95a
@ -2034,7 +2034,7 @@ begin
|
||||
AItem := AList.Items[i];
|
||||
Str := AItem{%H-}.Caption;
|
||||
Item := QtTreeWidget.topLevelItem(i);
|
||||
QtTreeWidget.setItemText(Item, 0, Str, AlignmentToQtAlignmentMap[AList.Column[0].Alignment]);
|
||||
QtTreeWidget.setItemText(Item, 0, Str, AlignmentToQtAlignmentMap[AList.Column[0].Alignment] or QtAlignVCenter);
|
||||
QtTreeWidget.setItemData(Item, 0, AItem);
|
||||
if AList.Checkboxes then
|
||||
begin
|
||||
@ -2071,7 +2071,7 @@ begin
|
||||
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
||||
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
||||
Str := AItem{%H-}.Subitems.Strings[j];
|
||||
QtTreeWidget.setItemText(Item, j + 1, Str, AAlignment);
|
||||
QtTreeWidget.setItemText(Item, j + 1, Str, AAlignment or QtAlignVCenter);
|
||||
QtTreeWidget.setItemData(Item, j + 1, AItem);
|
||||
if ImgListRes.Valid and (ImgListRes.Count > 0) and (AItem.SubItemImages[j] >= 0) then
|
||||
begin
|
||||
|
@ -2107,7 +2107,7 @@ begin
|
||||
AItem := AList.Items[i];
|
||||
WStr := AItem{%H-}.Caption;
|
||||
Item := QtTreeWidget.topLevelItem(i);
|
||||
QtTreeWidget.setItemText(Item, 0, WStr, AlignmentToQtAlignmentMap[AList.Column[0].Alignment]);
|
||||
QtTreeWidget.setItemText(Item, 0, WStr, AlignmentToQtAlignmentMap[AList.Column[0].Alignment] or QtAlignVCenter);
|
||||
QtTreeWidget.setItemData(Item, 0, AItem);
|
||||
if AList.Checkboxes then
|
||||
begin
|
||||
@ -2144,7 +2144,7 @@ begin
|
||||
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
||||
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
||||
WStr := AItem{%H-}.Subitems.Strings[j];
|
||||
QtTreeWidget.setItemText(Item, j + 1, WStr, AAlignment);
|
||||
QtTreeWidget.setItemText(Item, j + 1, WStr, AAlignment or QtAlignVCenter);
|
||||
QtTreeWidget.setItemData(Item, j + 1, AItem);
|
||||
if ImgListRes.Valid and (ImgListRes.Count > 0) and (AItem.SubItemImages[j] >= 0) then
|
||||
begin
|
||||
|
@ -744,7 +744,9 @@ begin
|
||||
begin
|
||||
if Assigned(ALV.LargeImages) then
|
||||
QtListWidget.IconSize := Size(ALV.LargeImages.Width, ALV.LargeImages.Height);
|
||||
end;
|
||||
end else
|
||||
if Assigned(ALV.SmallImages) then
|
||||
QtListWidget.IconSize := Size(ALV.SmallImages.Width, ALV.SmallImages.Height);
|
||||
|
||||
end else
|
||||
QtListWidget.setViewMode(QListViewListMode);
|
||||
@ -2104,7 +2106,7 @@ begin
|
||||
AItem := AList.Items[i];
|
||||
WStr := AItem{%H-}.Caption;
|
||||
Item := QtTreeWidget.topLevelItem(i);
|
||||
QtTreeWidget.setItemText(Item, 0, WStr, AlignmentToQtAlignmentMap[AList.Column[0].Alignment]);
|
||||
QtTreeWidget.setItemText(Item, 0, WStr, AlignmentToQtAlignmentMap[AList.Column[0].Alignment] or QtAlignVCenter);
|
||||
QtTreeWidget.setItemData(Item, 0, AItem);
|
||||
if AList.Checkboxes then
|
||||
begin
|
||||
@ -2141,7 +2143,7 @@ begin
|
||||
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
||||
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
||||
WStr := AItem{%H-}.Subitems.Strings[j];
|
||||
QtTreeWidget.setItemText(Item, j + 1, WStr, AAlignment);
|
||||
QtTreeWidget.setItemText(Item, j + 1, WStr, AAlignment or QtAlignVCenter);
|
||||
QtTreeWidget.setItemData(Item, j + 1, AItem);
|
||||
if ImgListRes.Valid and (ImgListRes.Count > 0) and (AItem.SubItemImages[j] >= 0) then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user