Qt, Qt5: trigger OnSelectionChanged for first click.part of issue #31697

git-svn-id: trunk@54707 -
This commit is contained in:
zeljko 2017-04-24 10:15:55 +00:00
parent 9150e859e8
commit 83167e5b0e
2 changed files with 5 additions and 2 deletions

View File

@ -13890,6 +13890,7 @@ begin
// issue #21318
MousePos := QMouseEvent_pos(QMouseEventH(Event))^;
Item := itemAt(MousePos.x, MousePos.y);
if QEvent_Type(Event) = QEventMouseButtonDblClick then
begin
SlotMouse(Widget, Event);
@ -13919,7 +13920,8 @@ begin
(QEvent_Type(Event) = QEventMouseButtonPress) then
begin
// change current row , this works fine with qt < 4.8
if Assigned(Item) and (currentItem <> Item) then
if Assigned(Item) and
((currentItem <> Item) or not QListWidgetItem_isSelected(Item)) then
begin
// DebugLn('TQtCheckListBox forced item change');
// Self.setCurrentItem(Item, True);

View File

@ -13895,7 +13895,8 @@ begin
if (QEvent_Type(Event) = QEventMouseButtonPress) then
begin
// change current row , this works fine with qt < 4.8
if Assigned(Item) and (currentItem <> Item) then
if Assigned(Item) and
((currentItem <> Item) or not QListWidgetItem_isSelected(Item)) then
begin
// DebugLn('TQtCheckListBox forced item change');
{issue #31697}