Bug 496144 - SelectableLabel's actions break other actions with same shortcut
Summary: SelectableLabel's actions break other actions with same shortcut
Status: REPORTED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: Not decided
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-11 18:49 UTC by george fb
Modified: 2024-11-11 18:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description george fb 2024-11-11 18:49:39 UTC
STEPS TO REPRODUCE
1. Create Action with StandardKey.Copy as shortcut
2. Create SelectableLabel
3. Trigger the StandardKey.Copy shortcut

OBSERVED RESULT
The Action with the StandardKey.Copy shortcut is triggered only after pressing the shortcut a number of times. 
The number of times needed to press the shortcut is 2*n, where n is the number of SelectableLabel instances.

EXPECTED RESULT
The Action is triggered every time the shortcut is pressed.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20241109
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.6-2-default (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
The copy action of the SelectableLabel is also broken as it becomes disabled when hovered.
Comment 1 george fb 2024-11-11 18:50:50 UTC
Sample app
```
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts

import org.kde.kirigami as Kirigami

Window {
    width: 640
    height: 480
    visible: true
    title: qsTr("Hello World")

    Action {
        shortcut: "ctrl+c"
        onTriggered: {
            console.log(rectangle.color)
            rectangle.color = rectangle.color == "#008000" ? "#ff0000" : "#008000"
        }
    }

    ColumnLayout {
        Rectangle {
            id: rectangle
            width: 100
            height: 100
            color: "#008000"
        }

        Kirigami.SelectableLabel {
            text: "12345"
        }
        Kirigami.SelectableLabel {
            text: "67890"
        }
        Kirigami.SelectableLabel {
            text: "67890"
        }
    }
}
```