mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 07:59:28 +02:00
Qt,Qt5,Qt6: fixed vertical alignment of text.issue #41465
This commit is contained in:
parent
0fff8e203f
commit
45eabe826d
@ -2034,7 +2034,7 @@ begin
|
|||||||
AItem := AList.Items[i];
|
AItem := AList.Items[i];
|
||||||
Str := AItem{%H-}.Caption;
|
Str := AItem{%H-}.Caption;
|
||||||
Item := QtTreeWidget.topLevelItem(i);
|
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);
|
QtTreeWidget.setItemData(Item, 0, AItem);
|
||||||
if AList.Checkboxes then
|
if AList.Checkboxes then
|
||||||
begin
|
begin
|
||||||
@ -2071,7 +2071,7 @@ begin
|
|||||||
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
||||||
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
||||||
Str := AItem{%H-}.Subitems.Strings[j];
|
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);
|
QtTreeWidget.setItemData(Item, j + 1, AItem);
|
||||||
if ImgListRes.Valid and (ImgListRes.Count > 0) and (AItem.SubItemImages[j] >= 0) then
|
if ImgListRes.Valid and (ImgListRes.Count > 0) and (AItem.SubItemImages[j] >= 0) then
|
||||||
begin
|
begin
|
||||||
|
@ -2107,7 +2107,7 @@ begin
|
|||||||
AItem := AList.Items[i];
|
AItem := AList.Items[i];
|
||||||
WStr := AItem{%H-}.Caption;
|
WStr := AItem{%H-}.Caption;
|
||||||
Item := QtTreeWidget.topLevelItem(i);
|
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);
|
QtTreeWidget.setItemData(Item, 0, AItem);
|
||||||
if AList.Checkboxes then
|
if AList.Checkboxes then
|
||||||
begin
|
begin
|
||||||
@ -2144,7 +2144,7 @@ begin
|
|||||||
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
||||||
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
||||||
WStr := AItem{%H-}.Subitems.Strings[j];
|
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);
|
QtTreeWidget.setItemData(Item, j + 1, AItem);
|
||||||
if ImgListRes.Valid and (ImgListRes.Count > 0) and (AItem.SubItemImages[j] >= 0) then
|
if ImgListRes.Valid and (ImgListRes.Count > 0) and (AItem.SubItemImages[j] >= 0) then
|
||||||
begin
|
begin
|
||||||
|
@ -744,7 +744,9 @@ begin
|
|||||||
begin
|
begin
|
||||||
if Assigned(ALV.LargeImages) then
|
if Assigned(ALV.LargeImages) then
|
||||||
QtListWidget.IconSize := Size(ALV.LargeImages.Width, ALV.LargeImages.Height);
|
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
|
end else
|
||||||
QtListWidget.setViewMode(QListViewListMode);
|
QtListWidget.setViewMode(QListViewListMode);
|
||||||
@ -2104,7 +2106,7 @@ begin
|
|||||||
AItem := AList.Items[i];
|
AItem := AList.Items[i];
|
||||||
WStr := AItem{%H-}.Caption;
|
WStr := AItem{%H-}.Caption;
|
||||||
Item := QtTreeWidget.topLevelItem(i);
|
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);
|
QtTreeWidget.setItemData(Item, 0, AItem);
|
||||||
if AList.Checkboxes then
|
if AList.Checkboxes then
|
||||||
begin
|
begin
|
||||||
@ -2141,7 +2143,7 @@ begin
|
|||||||
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
||||||
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
||||||
WStr := AItem{%H-}.Subitems.Strings[j];
|
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);
|
QtTreeWidget.setItemData(Item, j + 1, AItem);
|
||||||
if ImgListRes.Valid and (ImgListRes.Count > 0) and (AItem.SubItemImages[j] >= 0) then
|
if ImgListRes.Valid and (ImgListRes.Count > 0) and (AItem.SubItemImages[j] >= 0) then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user