Qt: added lvpHideSelection feature to TQtWSCustomListView

git-svn-id: trunk@21462 -
This commit is contained in:
zeljko 2009-08-27 10:52:05 +00:00
parent 4f6c0f0f22
commit bb3984fa0a

View File

@ -1282,9 +1282,12 @@ const
begin
if not WSCheckHandleAllocated(ALV, 'SetProperty')
then Exit;
case AProp of
lvpMultiSelect: TQtTreeWidget(ALV.Handle).setSelectionMode(BoolToSelectionMode[AIsSet]);
lvpMultiSelect:
begin
if (TQtTreeWidget(ALV.Handle).getSelectionMode <> QAbstractItemViewNoSelection) then
TQtTreeWidget(ALV.Handle).setSelectionMode(BoolToSelectionMode[AIsSet]);
end;
lvpShowColumnHeaders: TQtTreeWidget(ALV.Handle).setHeaderVisible(AIsSet);
lvpReadOnly: TQtTreeWidget(ALV.Handle).setEditTriggers(BoolToEditTriggers[AIsSet]);
lvpRowSelect:
@ -1293,6 +1296,15 @@ begin
TQtTreeWidget(ALV.Handle).setSelectionBehavior(BoolToSelectionBehavior[AIsSet]);
end;
lvpWrapText: TQtTreeWidget(ALV.Handle).setWordWrap(AIsSet);
lvpHideSelection:
begin
if AIsSet then
begin
TQtTreeWidget(ALV.Handle).clearSelection;
TQtTreeWidget(ALV.Handle).setSelectionMode(QAbstractItemViewNoSelection);
end else
TQtTreeWidget(ALV.Handle).setSelectionMode(BoolToSelectionMode[ALV.MultiSelect]);
end;
end;
end;
@ -1303,7 +1315,6 @@ var
begin
if not WSCheckHandleAllocated(ALV, 'SetProperties')
then Exit;
for i := Low(TListViewProperty) to High(TListViewProperty) do
SetProperty(ALV, i, i in AProps);
end;