mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 07:39:22 +02:00
Qt: correct cast, use TCustomListView instead TListView.
git-svn-id: trunk@46852 -
This commit is contained in:
parent
eb58ee35fa
commit
1607deedbe
@ -11378,6 +11378,9 @@ begin
|
|||||||
Result := QListWidget_create(Parent);
|
Result := QListWidget_create(Parent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
type
|
||||||
|
TCustomListViewHack = class(TCustomListView);
|
||||||
|
|
||||||
procedure TQtListWidget.OwnerDataNeeded(ARect: TRect);
|
procedure TQtListWidget.OwnerDataNeeded(ARect: TRect);
|
||||||
var
|
var
|
||||||
R: TRect;
|
R: TRect;
|
||||||
@ -11409,7 +11412,7 @@ begin
|
|||||||
TopItem := getRow(Item);
|
TopItem := getRow(Item);
|
||||||
RowHeight := getRowHeight(TopItem);
|
RowHeight := getRowHeight(TopItem);
|
||||||
|
|
||||||
if (TopItem < 0) or (TopItem > TListView(LCLObject).Items.Count - 1) then
|
if (TopItem < 0) or (TopItem > TCustomListViewHack(LCLObject).Items.Count - 1) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
i := 0;
|
i := 0;
|
||||||
@ -11422,15 +11425,15 @@ begin
|
|||||||
TopItem := getRow(Item);
|
TopItem := getRow(Item);
|
||||||
RowHeight := getRowHeight(TopItem);
|
RowHeight := getRowHeight(TopItem);
|
||||||
|
|
||||||
if (TopItem < 0) or (TopItem > TListView(LCLObject).Items.Count - 1) then
|
if (TopItem < 0) or (TopItem > TCustomListViewHack(LCLObject).Items.Count - 1) then
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (TListView(LCLObject).Items[TopItem].ImageIndex <> -1) then
|
if (TCustomListViewHack(LCLObject).Items[TopItem].ImageIndex <> -1) then
|
||||||
begin
|
begin
|
||||||
// TODO: paint icons and reduce paint overhead by checking icon
|
// TODO: paint icons and reduce paint overhead by checking icon
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WStr := GetUTF8String(TListView(LCLObject).Items[TopItem].Caption);
|
WStr := GetUTF8String(TCustomListViewHack(LCLObject).Items[TopItem].Caption);
|
||||||
|
|
||||||
// reduce paint overhead by checking text
|
// reduce paint overhead by checking text
|
||||||
v := QVariant_create();
|
v := QVariant_create();
|
||||||
@ -11441,7 +11444,7 @@ begin
|
|||||||
DataStr := '';
|
DataStr := '';
|
||||||
QVariant_destroy(v);
|
QVariant_destroy(v);
|
||||||
|
|
||||||
ASelected := TListView(LCLObject).Items[TopItem].Selected;
|
ASelected := TCustomListViewHack(LCLObject).Items[TopItem].Selected;
|
||||||
|
|
||||||
if (DataStr <> WStr) then
|
if (DataStr <> WStr) then
|
||||||
begin
|
begin
|
||||||
@ -13429,7 +13432,7 @@ begin
|
|||||||
TopItem := getRow(item);
|
TopItem := getRow(item);
|
||||||
RowHeight := getRowHeight(TopItem);
|
RowHeight := getRowHeight(TopItem);
|
||||||
|
|
||||||
if (TopItem < 0) or (TopItem > TListView(LCLObject).Items.Count - 1) then
|
if (TopItem < 0) or (TopItem > TCustomListViewHack(LCLObject).Items.Count - 1) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
i := 0;
|
i := 0;
|
||||||
@ -13443,11 +13446,11 @@ begin
|
|||||||
TopItem := getRow(item);
|
TopItem := getRow(item);
|
||||||
RowHeight := getRowHeight(TopItem);
|
RowHeight := getRowHeight(TopItem);
|
||||||
|
|
||||||
if (TopItem < 0) or (TopItem > TListView(LCLObject).Items.Count - 1) then
|
if (TopItem < 0) or (TopItem > TCustomListViewHack(LCLObject).Items.Count - 1) then
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
WStr := GetUTF8String(TListView(LCLObject).Items[TopItem].Caption);
|
WStr := GetUTF8String(TCustomListViewHack(LCLObject).Items[TopItem].Caption);
|
||||||
ASelected := TListView(LCLObject).Items[TopItem].Selected;
|
ASelected := TCustomListViewHack(LCLObject).Items[TopItem].Selected;
|
||||||
|
|
||||||
v := QVariant_create(PWideString(@WStr));
|
v := QVariant_create(PWideString(@WStr));
|
||||||
try
|
try
|
||||||
@ -13457,14 +13460,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
ChildCount := QTreeWidgetItem_childCount(Item);
|
ChildCount := QTreeWidgetItem_childCount(Item);
|
||||||
if ChildCount = TListView(LCLObject).Items[TopItem].SubItems.Count then
|
if ChildCount = TCustomListViewHack(LCLObject).Items[TopItem].SubItems.Count then
|
||||||
begin
|
begin
|
||||||
for j := 0 to ChildCount - 1 do
|
for j := 0 to ChildCount - 1 do
|
||||||
begin
|
begin
|
||||||
itemChild := QTreeWidgetItem_child(item, j);
|
itemChild := QTreeWidgetItem_child(item, j);
|
||||||
if itemChild <> nil then
|
if itemChild <> nil then
|
||||||
begin
|
begin
|
||||||
WStr := GetUTF8String(TListView(LCLObject).Items[TopItem].SubItems[j]);
|
WStr := GetUTF8String(TCustomListViewHack(LCLObject).Items[TopItem].SubItems[j]);
|
||||||
v := QVariant_create(PWideString(@WStr));
|
v := QVariant_create(PWideString(@WStr));
|
||||||
QTreeWidgetItem_setData(itemChild, 0, Ord(QtDisplayRole), v);
|
QTreeWidgetItem_setData(itemChild, 0, Ord(QtDisplayRole), v);
|
||||||
QVariant_destroy(v);
|
QVariant_destroy(v);
|
||||||
@ -13472,9 +13475,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
for j := 0 to TListView(LCLObject).Items[TopItem].SubItems.Count - 1 do
|
for j := 0 to TCustomListViewHack(LCLObject).Items[TopItem].SubItems.Count - 1 do
|
||||||
begin
|
begin
|
||||||
WStr := GetUTF8String(TListView(LCLObject).Items[TopItem].SubItems[j]);
|
WStr := GetUTF8String(TCustomListViewHack(LCLObject).Items[TopItem].SubItems[j]);
|
||||||
v := QVariant_create(PWideString(@WStr));
|
v := QVariant_create(PWideString(@WStr));
|
||||||
QTreeWidgetItem_setData(item, j + 1, Ord(QtDisplayRole), v);
|
QTreeWidgetItem_setData(item, j + 1, Ord(QtDisplayRole), v);
|
||||||
QVariant_destroy(v);
|
QVariant_destroy(v);
|
||||||
@ -14302,7 +14305,7 @@ begin
|
|||||||
B := False;
|
B := False;
|
||||||
if (ViewStyle = Ord(vsReport)) and (Previous <> nil) then
|
if (ViewStyle = Ord(vsReport)) and (Previous <> nil) then
|
||||||
begin
|
begin
|
||||||
ListItem := TListView(LCLObject).Selected;
|
ListItem := TCustomListViewHack(LCLObject).Selected;
|
||||||
if ListItem <> nil then
|
if ListItem <> nil then
|
||||||
B := ListItem.Index = AIndex;
|
B := ListItem.Index = AIndex;
|
||||||
end;
|
end;
|
||||||
@ -14351,7 +14354,7 @@ begin
|
|||||||
if (ViewStyle = Ord(vsReport)) and (Current <> nil) and
|
if (ViewStyle = Ord(vsReport)) and (Current <> nil) and
|
||||||
(Current <> Previous) then
|
(Current <> Previous) then
|
||||||
begin
|
begin
|
||||||
ListItem := TListView(LCLObject).Selected;
|
ListItem := TCustomListViewHack(LCLObject).Selected;
|
||||||
if ListItem <> nil then
|
if ListItem <> nil then
|
||||||
B := ListItem.Index = AIndex;
|
B := ListItem.Index = AIndex;
|
||||||
end;
|
end;
|
||||||
|
@ -689,20 +689,19 @@ end;
|
|||||||
|
|
||||||
{ TQtWSCustomListView }
|
{ TQtWSCustomListView }
|
||||||
|
|
||||||
|
type
|
||||||
|
TCustomListViewHack = class(TCustomListView);
|
||||||
|
|
||||||
|
class function TQtWSCustomListView.IsIconView(const AList: TCustomListView): boolean;
|
||||||
|
begin
|
||||||
|
Result := TCustomListViewHack(AList).ViewStyle <> vsReport;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Method: TQtWSCustomListView.CreateHandle
|
Method: TQtWSCustomListView.CreateHandle
|
||||||
Params: None
|
Params: None
|
||||||
Returns: Nothing
|
Returns: Nothing
|
||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
|
|
||||||
class function TQtWSCustomListView.IsIconView(const AList: TCustomListView): boolean;
|
|
||||||
begin
|
|
||||||
Result := TListView(AList).ViewStyle <> vsReport;
|
|
||||||
end;
|
|
||||||
|
|
||||||
type
|
|
||||||
TCustomListViewHack = class(TCustomListView);
|
|
||||||
|
|
||||||
class function TQtWSCustomListView.CreateHandle(const AWinControl: TWinControl;
|
class function TQtWSCustomListView.CreateHandle(const AWinControl: TWinControl;
|
||||||
const AParams: TCreateParams): TLCLIntfHandle;
|
const AParams: TCreateParams): TLCLIntfHandle;
|
||||||
var
|
var
|
||||||
@ -714,8 +713,8 @@ begin
|
|||||||
if IsIconView(TCustomListView(AWinControl)) then
|
if IsIconView(TCustomListView(AWinControl)) then
|
||||||
begin
|
begin
|
||||||
QtListWidget := TQtListWidget.Create(AWinControl, AParams);
|
QtListWidget := TQtListWidget.Create(AWinControl, AParams);
|
||||||
QtListWidget.ViewStyle := Ord(TListView(AWinControl).ViewStyle);
|
QtListWidget.ViewStyle := Ord(TCustomListViewHack(AWinControl).ViewStyle);
|
||||||
if TListView(AWinControl).ViewStyle in [vsIcon, vsSmallIcon] then
|
if TCustomListViewHack(AWinControl).ViewStyle in [vsIcon, vsSmallIcon] then
|
||||||
begin
|
begin
|
||||||
// emabarcadero docs says
|
// emabarcadero docs says
|
||||||
// vsIcon, vsSmallIcon
|
// vsIcon, vsSmallIcon
|
||||||
@ -742,7 +741,7 @@ begin
|
|||||||
end else
|
end else
|
||||||
begin
|
begin
|
||||||
QtTreeWidget := TQtTreeWidget.Create(AWinControl, AParams);
|
QtTreeWidget := TQtTreeWidget.Create(AWinControl, AParams);
|
||||||
QtTreeWidget.ViewStyle := Ord(TListView(AWinControl).ViewStyle);
|
QtTreeWidget.ViewStyle := Ord(TCustomListViewHack(AWinControl).ViewStyle);
|
||||||
QtTreeWidget.OwnerDrawn := ALV.IsCustomDrawn(dtControl, cdPrePaint) or (ALV.OwnerDraw and
|
QtTreeWidget.OwnerDrawn := ALV.IsCustomDrawn(dtControl, cdPrePaint) or (ALV.OwnerDraw and
|
||||||
(ALV.ViewStyle = vsReport));
|
(ALV.ViewStyle = vsReport));
|
||||||
QtTreeWidget.setStretchLastSection(False);
|
QtTreeWidget.setStretchLastSection(False);
|
||||||
@ -794,10 +793,10 @@ begin
|
|||||||
|
|
||||||
QtTreeWidget := TQtTreeWidget(ALV.Handle);
|
QtTreeWidget := TQtTreeWidget(ALV.Handle);
|
||||||
|
|
||||||
if QtTreeWidget.ColCount <> TListView(ALV).Columns.Count then
|
if QtTreeWidget.ColCount <> TCustomListViewHack(ALV).Columns.Count then
|
||||||
QtTreeWidget.ColCount := TListView(ALV).Columns.Count;
|
QtTreeWidget.ColCount := TCustomListViewHack(ALV).Columns.Count;
|
||||||
|
|
||||||
if (QtTreeWidget.ColCount <= 1) and TListView(ALV).ShowColumnHeaders then
|
if (QtTreeWidget.ColCount <= 1) and TCustomListViewHack(ALV).ShowColumnHeaders then
|
||||||
QtTreeWidget.setHeaderVisible(True);
|
QtTreeWidget.setHeaderVisible(True);
|
||||||
|
|
||||||
TWI := QtTreeWidget.headerItem;
|
TWI := QtTreeWidget.headerItem;
|
||||||
@ -814,7 +813,7 @@ begin
|
|||||||
if (csDesigning in ALV.ComponentState) then
|
if (csDesigning in ALV.ComponentState) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
QtTreeWidget.Header.Clickable := TListView(ALV).ColumnClick;
|
QtTreeWidget.Header.Clickable := TCustomListViewHack(ALV).ColumnClick;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
@ -978,13 +977,13 @@ begin
|
|||||||
begin
|
begin
|
||||||
ImgList := TImageList.Create(nil);
|
ImgList := TImageList.Create(nil);
|
||||||
try
|
try
|
||||||
if (TListView(ALV).ViewStyle = vsIcon) and
|
if (TCustomListViewHack(ALV).ViewStyle = vsIcon) and
|
||||||
Assigned(TListView(ALV).LargeImages) then
|
Assigned(TCustomListViewHack(ALV).LargeImages) then
|
||||||
ImgList.Assign(TListView(ALV).LargeImages);
|
ImgList.Assign(TCustomListViewHack(ALV).LargeImages);
|
||||||
|
|
||||||
if (TListView(ALV).ViewStyle in [vsSmallIcon, vsReport, vsList]) and
|
if (TCustomListViewHack(ALV).ViewStyle in [vsSmallIcon, vsReport, vsList]) and
|
||||||
Assigned(TListView(ALV).SmallImages) then
|
Assigned(TCustomListViewHack(ALV).SmallImages) then
|
||||||
ImgList.Assign(TListView(ALV).SmallImages);
|
ImgList.Assign(TCustomListViewHack(ALV).SmallImages);
|
||||||
|
|
||||||
if (ImgList.Count > 0) and
|
if (ImgList.Count > 0) and
|
||||||
((AImageIndex >= 0) and (AImageIndex < ImgList.Count)) then
|
((AImageIndex >= 0) and (AImageIndex < ImgList.Count)) then
|
||||||
@ -1273,8 +1272,8 @@ begin
|
|||||||
if not WSCheckHandleAllocated(ALV, 'ItemSetImage') then
|
if not WSCheckHandleAllocated(ALV, 'ItemSetImage') then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
if not Assigned(TListView(ALV).LargeImages) and not
|
if not Assigned(TCustomListViewHack(ALV).LargeImages) and not
|
||||||
Assigned(TListView(ALV).SmallImages) then
|
Assigned(TCustomListViewHack(ALV).SmallImages) then
|
||||||
exit;
|
exit;
|
||||||
TWI := nil;
|
TWI := nil;
|
||||||
LWI := nil;
|
LWI := nil;
|
||||||
@ -1293,13 +1292,13 @@ begin
|
|||||||
begin
|
begin
|
||||||
ImgList := TImageList.Create(nil);
|
ImgList := TImageList.Create(nil);
|
||||||
try
|
try
|
||||||
if (TListView(ALV).ViewStyle = vsIcon) and
|
if (TCustomListViewHack(ALV).ViewStyle = vsIcon) and
|
||||||
Assigned(TListView(ALV).LargeImages) then
|
Assigned(TCustomListViewHack(ALV).LargeImages) then
|
||||||
ImgList.Assign(TListView(ALV).LargeImages);
|
ImgList.Assign(TCustomListViewHack(ALV).LargeImages);
|
||||||
|
|
||||||
if (TListView(ALV).ViewStyle in [vsSmallIcon, vsReport, vsList]) and
|
if (TCustomListViewHack(ALV).ViewStyle in [vsSmallIcon, vsReport, vsList]) and
|
||||||
Assigned(TListView(ALV).SmallImages) then
|
Assigned(TCustomListViewHack(ALV).SmallImages) then
|
||||||
ImgList.Assign(TListView(ALV).SmallImages);
|
ImgList.Assign(TCustomListViewHack(ALV).SmallImages);
|
||||||
|
|
||||||
if (ImgList.Count > 0) and
|
if (ImgList.Count > 0) and
|
||||||
((AImageIndex >= 0) and (AImageIndex < ImgList.Count)) then
|
((AImageIndex >= 0) and (AImageIndex < ImgList.Count)) then
|
||||||
@ -1453,7 +1452,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
AAlignment := QtAlignLeft;
|
AAlignment := QtAlignLeft;
|
||||||
if TListView(ALV).Columns.Count > 0 then
|
if TCustomListViewHack(ALV).Columns.Count > 0 then
|
||||||
AAlignment := AlignmentToQtAlignmentMap[ALV.Column[0].Alignment];
|
AAlignment := AlignmentToQtAlignmentMap[ALV.Column[0].Alignment];
|
||||||
|
|
||||||
if Str <> '' then
|
if Str <> '' then
|
||||||
@ -1464,7 +1463,7 @@ begin
|
|||||||
for i := 0 to AItem.SubItems.Count - 1 do
|
for i := 0 to AItem.SubItems.Count - 1 do
|
||||||
begin
|
begin
|
||||||
AAlignment := QtAlignLeft;
|
AAlignment := QtAlignLeft;
|
||||||
if (TListView(ALV).Columns.Count > 0) and (i + 1 < TListView(ALV).Columns.Count) then
|
if (TCustomListViewHack(ALV).Columns.Count > 0) and (i + 1 < TCustomListViewHack(ALV).Columns.Count) then
|
||||||
AAlignment := AlignmentToQtAlignmentMap[ALV.Column[i + 1].Alignment];
|
AAlignment := AlignmentToQtAlignmentMap[ALV.Column[i + 1].Alignment];
|
||||||
if AItem.Subitems.Strings[i] <> '' then
|
if AItem.Subitems.Strings[i] <> '' then
|
||||||
begin
|
begin
|
||||||
@ -1515,7 +1514,7 @@ begin
|
|||||||
if ASubIndex >0 Then exit;
|
if ASubIndex >0 Then exit;
|
||||||
QtListWidget := TQtListWidget(ALV.Handle);
|
QtListWidget := TQtListWidget(ALV.Handle);
|
||||||
AAlignment := QtAlignLeft;
|
AAlignment := QtAlignLeft;
|
||||||
if (TListView(ALV).Columns.Count > 0) and (ASubIndex < TListView(ALV).Columns.Count) then
|
if (TCustomListViewHack(ALV).Columns.Count > 0) and (ASubIndex < TCustomListViewHack(ALV).Columns.Count) then
|
||||||
AAlignment := AlignmentToQtAlignmentMap[ALV.Column[ASubIndex].Alignment];
|
AAlignment := AlignmentToQtAlignmentMap[ALV.Column[ASubIndex].Alignment];
|
||||||
QtListWidget.setItemText(AIndex, AText, AAlignment);
|
QtListWidget.setItemText(AIndex, AText, AAlignment);
|
||||||
end else
|
end else
|
||||||
@ -1526,7 +1525,7 @@ begin
|
|||||||
if TWI <> NiL then
|
if TWI <> NiL then
|
||||||
begin
|
begin
|
||||||
AAlignment := QtAlignLeft;
|
AAlignment := QtAlignLeft;
|
||||||
if (TListView(ALV).Columns.Count > 0) and (ASubIndex < TListView(ALV).Columns.Count) then
|
if (TCustomListViewHack(ALV).Columns.Count > 0) and (ASubIndex < TCustomListViewHack(ALV).Columns.Count) then
|
||||||
AAlignment := AlignmentToQtAlignmentMap[ALV.Column[ASubIndex].Alignment];
|
AAlignment := AlignmentToQtAlignmentMap[ALV.Column[ASubIndex].Alignment];
|
||||||
QtTreeWidget.setItemText(TWI, ASubIndex, Str, AAlignment);
|
QtTreeWidget.setItemText(TWI, ASubIndex, Str, AAlignment);
|
||||||
end;
|
end;
|
||||||
@ -1759,7 +1758,7 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
// according to embarcadero docs this should return
|
// according to embarcadero docs this should return
|
||||||
// only for vsList and vsReport
|
// only for vsList and vsReport
|
||||||
if not (TListView(ALV).ViewStyle in [vsList, vsReport]) then
|
if not (TCustomListViewHack(ALV).ViewStyle in [vsList, vsReport]) then
|
||||||
exit;
|
exit;
|
||||||
QtItemView := TQtAbstractItemView(ALV.Handle);
|
QtItemView := TQtAbstractItemView(ALV.Handle);
|
||||||
Result := QtItemView.getTopItem;
|
Result := QtItemView.getTopItem;
|
||||||
@ -1788,13 +1787,13 @@ begin
|
|||||||
QtTreeWidget := TQtTreeWidget(AList.Handle);
|
QtTreeWidget := TQtTreeWidget(AList.Handle);
|
||||||
ImgList := TImageList.Create(nil);
|
ImgList := TImageList.Create(nil);
|
||||||
|
|
||||||
if (TListView(AList).ViewStyle = vsIcon) and
|
if (TCustomListViewHack(AList).ViewStyle = vsIcon) and
|
||||||
Assigned(TListView(AList).LargeImages) then
|
Assigned(TCustomListViewHack(AList).LargeImages) then
|
||||||
ImgList.Assign(TListView(AList).LargeImages);
|
ImgList.Assign(TCustomListViewHack(AList).LargeImages);
|
||||||
|
|
||||||
if (TListView(AList).ViewStyle in [vsSmallIcon, vsReport, vsList]) and
|
if (TCustomListViewHack(AList).ViewStyle in [vsSmallIcon, vsReport, vsList]) and
|
||||||
Assigned(TListView(AList).SmallImages) then
|
Assigned(TCustomListViewHack(AList).SmallImages) then
|
||||||
ImgList.Assign(TListView(AList).SmallImages);
|
ImgList.Assign(TCustomListViewHack(AList).SmallImages);
|
||||||
|
|
||||||
BeginUpdate(AList);
|
BeginUpdate(AList);
|
||||||
try
|
try
|
||||||
@ -1830,8 +1829,8 @@ begin
|
|||||||
for j := 0 to AItem.SubItems.Count - 1 do
|
for j := 0 to AItem.SubItems.Count - 1 do
|
||||||
begin
|
begin
|
||||||
AAlignment := QtAlignLeft;
|
AAlignment := QtAlignLeft;
|
||||||
if (TListView(AList).Columns.Count > 0) and (j + 1 < TListView(AList).Columns.Count) then
|
if (TCustomListViewHack(AList).Columns.Count > 0) and (j + 1 < TCustomListViewHack(AList).Columns.Count) then
|
||||||
AAlignment := AlignmentToQtAlignmentMap[TListView(AList).Column[j + 1].Alignment];
|
AAlignment := AlignmentToQtAlignmentMap[TCustomListViewHack(AList).Column[j + 1].Alignment];
|
||||||
WStr := GetUtf8String(AItem.Subitems.Strings[j]);
|
WStr := GetUtf8String(AItem.Subitems.Strings[j]);
|
||||||
QtTreeWidget.setItemText(Item, j + 1, WStr, AAlignment);
|
QtTreeWidget.setItemText(Item, j + 1, WStr, AAlignment);
|
||||||
QtTreeWidget.setItemData(Item, j + 1, AItem);
|
QtTreeWidget.setItemData(Item, j + 1, AItem);
|
||||||
@ -1952,7 +1951,7 @@ var
|
|||||||
begin
|
begin
|
||||||
if not WSCheckHandleAllocated(ALV, 'SetAllocBy') then
|
if not WSCheckHandleAllocated(ALV, 'SetAllocBy') then
|
||||||
Exit;
|
Exit;
|
||||||
if TListView(ALV).ViewStyle <> vsReport then
|
if TCustomListViewHack(ALV).ViewStyle <> vsReport then
|
||||||
begin
|
begin
|
||||||
NewValue := AValue;
|
NewValue := AValue;
|
||||||
if NewValue < 0 then
|
if NewValue < 0 then
|
||||||
@ -2082,8 +2081,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
if not IsIconView(ALV) then
|
if not IsIconView(ALV) then
|
||||||
with TQtTreeWidget(ALV.Handle) do
|
with TQtTreeWidget(ALV.Handle) do
|
||||||
setHeaderVisible(AIsSet and (TListView(ALV).ViewStyle = vsReport)
|
setHeaderVisible(AIsSet and (TCustomListViewHack(ALV).ViewStyle = vsReport)
|
||||||
and (TListView(ALV).Columns.Count > 0) );
|
and (TCustomListViewHack(ALV).Columns.Count > 0) );
|
||||||
end;
|
end;
|
||||||
lvpOwnerDraw: ; // utilized automatically.
|
lvpOwnerDraw: ; // utilized automatically.
|
||||||
lvpReadOnly: QtItemView.setEditTriggers(BoolToEditTriggers[AIsSet]);
|
lvpReadOnly: QtItemView.setEditTriggers(BoolToEditTriggers[AIsSet]);
|
||||||
@ -2156,8 +2155,8 @@ begin
|
|||||||
QtTreeWidget := TQtTreeWidget(ALV.Handle);
|
QtTreeWidget := TQtTreeWidget(ALV.Handle);
|
||||||
ItemViewWidget := QTreeWidgetH(QtTreeWidget.Widget);
|
ItemViewWidget := QTreeWidgetH(QtTreeWidget.Widget);
|
||||||
with QtTreeWidget do
|
with QtTreeWidget do
|
||||||
setHeaderVisible(TListView(ALV).ShowColumnHeaders and (AValue = vsReport)
|
setHeaderVisible(TCustomListViewHack(ALV).ShowColumnHeaders and (AValue = vsReport)
|
||||||
and (TListView(ALV).Columns.Count > 0) );
|
and (TCustomListViewHack(ALV).Columns.Count > 0) );
|
||||||
end;
|
end;
|
||||||
case AValue of
|
case AValue of
|
||||||
vsIcon:
|
vsIcon:
|
||||||
@ -2165,10 +2164,10 @@ begin
|
|||||||
x := GetPixelMetric(QStylePM_IconViewIconSize, nil, ItemViewWidget);
|
x := GetPixelMetric(QStylePM_IconViewIconSize, nil, ItemViewWidget);
|
||||||
Size.cx := x;
|
Size.cx := x;
|
||||||
Size.cy := x;
|
Size.cy := x;
|
||||||
if Assigned(TListView(ALV).LargeImages) then
|
if Assigned(TCustomListViewHack(ALV).LargeImages) then
|
||||||
begin
|
begin
|
||||||
Size.cy := TListView(ALV).LargeImages.Height;
|
Size.cy := TCustomListViewHack(ALV).LargeImages.Height;
|
||||||
Size.cx := TListView(ALV).LargeImages.Width;
|
Size.cx := TCustomListViewHack(ALV).LargeImages.Width;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
vsSmallIcon:
|
vsSmallIcon:
|
||||||
@ -2176,10 +2175,10 @@ begin
|
|||||||
x := GetPixelMetric(QStylePM_ListViewIconSize, nil, ItemViewWidget);
|
x := GetPixelMetric(QStylePM_ListViewIconSize, nil, ItemViewWidget);
|
||||||
Size.cx := x;
|
Size.cx := x;
|
||||||
Size.cy := x;
|
Size.cy := x;
|
||||||
if Assigned(TListView(ALV).SmallImages) then
|
if Assigned(TCustomListViewHack(ALV).SmallImages) then
|
||||||
begin
|
begin
|
||||||
Size.cy := TListView(ALV).SmallImages.Height;
|
Size.cy := TCustomListViewHack(ALV).SmallImages.Height;
|
||||||
Size.cx := TListView(ALV).SmallImages.Width;
|
Size.cx := TCustomListViewHack(ALV).SmallImages.Width;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
vsList, vsReport:
|
vsList, vsReport:
|
||||||
|
Loading…
Reference in New Issue
Block a user