Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Workaround Qt >= 5.9.2 crash in qml menu on parent deletion

parent e2c2f581
......@@ -18,7 +18,6 @@
import QtQuick 2.6
import QtQuick.Controls 2.2
import QtQuick.Controls 1.4 as OLD
import Kdenlive.Controls 1.0
import QtGraphicalEffects 1.0
import QtQml.Models 2.2
......@@ -266,7 +265,11 @@ Rectangle {
}
onClicked: {
if (mouse.button == Qt.RightButton) {
menu.popup()
clipMenu.clipId = clipRoot.clipId
clipMenu.clipStatus = clipRoot.clipStatus
clipMenu.grouped = clipRoot.grouped
clipMenu.trackId = clipRoot.trackId
clipMenu.popup()
}
}
onDoubleClicked: {
......@@ -729,103 +732,7 @@ Rectangle {
onExited: parent.opacity = 0
}
}
OLD.Menu {
id: menu
function show() {
//mergeItem.visible = timeline.mergeClipWithNext(trackIndex, index, true)
menu.popup()
}
OLD.MenuItem {
visible: true
text: i18n('Cut')
onTriggered: {
console.log('cutting clip:', clipRoot.clipId)
if (!parentTrack.isLocked) {
timeline.requestClipCut(clipRoot.clipId, timeline.position)
} else {
root.pulseLockButtonOnTrack(currentTrack)
}
}
}
OLD.MenuItem {
visible: !grouped && parentTrack.selection.length > 1
text: i18n('Group')
onTriggered: timeline.triggerAction('group_clip')
}
OLD.MenuItem {
visible: grouped
text: i18n('Ungroup')
onTriggered: timeline.unGroupSelection(clipId)
}
OLD.MenuItem {
visible: true
text: i18n('Copy')
onTriggered: root.copiedClip = clipRoot.clipId
}
OLD.MenuSeparator {
visible: true
}
OLD.MenuItem {
text: i18n('Split Audio')
onTriggered: timeline.splitAudio(clipRoot.clipId)
visible: clipStatus == 0
}
OLD.MenuItem {
text: i18n('Remove')
onTriggered: timeline.triggerAction('delete_timeline_clip')
}
OLD.MenuItem {
visible: true
text: i18n('Extract')
onTriggered: timeline.extract(clipRoot.clipId)
}
OLD.MenuSeparator {
visible: true
}
OLD.MenuItem {
text: i18n('Clip in Project Bin')
onTriggered: timeline.triggerAction('clip_in_project_tree')
}
OLD.MenuItem {
visible: true
text: i18n('Split At Playhead')
onTriggered: timeline.triggerAction('cut_timeline_clip')
}
OLD.Menu {
title: i18n('Clip Type...')
OLD.ExclusiveGroup {
id: radioInputGroup
}
OLD.MenuItem {
text: i18n('Original')
checkable: true
checked: clipStatus == 0
exclusiveGroup: radioInputGroup
onTriggered: timeline.setClipStatus(clipRoot.clipId, 0)
}
OLD.MenuItem {
text: i18n('Video Only')
checkable: true
checked: clipStatus == 1
exclusiveGroup: radioInputGroup
onTriggered: timeline.setClipStatus(clipRoot.clipId, 1)
}
OLD.MenuItem {
text: i18n('Audio Only')
checkable: true
checked: clipStatus == 2
exclusiveGroup: radioInputGroup
onTriggered: timeline.setClipStatus(clipRoot.clipId, 2)
}
OLD.MenuItem {
text: i18n('Disabled')
checkable: true
checked: clipStatus == 3
exclusiveGroup: radioInputGroup
onTriggered: timeline.setClipStatus(clipRoot.clipId, 3)
}
}
/*MenuItem {
id: mergeItem
text: i18n('Merge with next clip')
......@@ -842,5 +749,4 @@ Rectangle {
menu.__xOffset = Math.min(0, Screen.width - (__popupGeometry.x + __popupGeometry.width))
}
}*/
}
}
import QtQuick 2.6
import QtQuick.Controls 1.4 as OLD
OLD.Menu {
id: clipMenu
property int clipId
property int clipStatus
property int trackId
property bool grouped
function show() {
//mergeItem.visible = timeline.mergeClipWithNext(trackIndex, index, true)
menu.popup()
}
OLD.MenuItem {
visible: true
text: i18n('Cut')
onTriggered: {
console.log('cutting clip:', clipId)
if (!parentTrack.isLocked) {
timeline.requestClipCut(clipId, timeline.position)
} else {
root.pulseLockButtonOnTrack(trackId)
}
}
}
OLD.MenuItem {
visible: !grouped && timeline.selection.length > 1
text: i18n('Group')
onTriggered: timeline.triggerAction('group_clip')
}
OLD.MenuItem {
visible: grouped
text: i18n('Ungroup')
onTriggered: timeline.unGroupSelection(clipId)
}
OLD.MenuItem {
visible: true
text: i18n('Copy')
onTriggered: root.copiedClip = clipId
}
OLD.MenuSeparator {
visible: true
}
OLD.MenuItem {
text: i18n('Split Audio')
onTriggered: timeline.splitAudio(clipId)
visible: clipStatus == 0
}
OLD.MenuItem {
text: i18n('Remove')
onTriggered: timeline.triggerAction('delete_timeline_clip')
}
OLD.MenuItem {
visible: true
text: i18n('Extract')
onTriggered: timeline.extract(clipId)
}
OLD.MenuSeparator {
visible: true
}
OLD.MenuItem {
text: i18n('Clip in Project Bin')
onTriggered: timeline.triggerAction('clip_in_project_tree')
}
OLD.MenuItem {
visible: true
text: i18n('Split At Playhead')
onTriggered: timeline.triggerAction('cut_timeline_clip')
}
OLD.Menu {
title: i18n('Clip Type...')
OLD.ExclusiveGroup {
id: radioInputGroup
}
OLD.MenuItem {
text: i18n('Original')
checkable: true
checked: clipStatus == 0
exclusiveGroup: radioInputGroup
onTriggered: timeline.setClipStatus(clipId, 0)
}
OLD.MenuItem {
text: i18n('Video Only')
checkable: true
checked: clipStatus == 1
exclusiveGroup: radioInputGroup
onTriggered: timeline.setClipStatus(clipId, 1)
}
OLD.MenuItem {
text: i18n('Audio Only')
checkable: true
checked: clipStatus == 2
exclusiveGroup: radioInputGroup
onTriggered: timeline.setClipStatus(clipId, 2)
}
OLD.MenuItem {
text: i18n('Disabled')
checkable: true
checked: clipStatus == 3
exclusiveGroup: radioInputGroup
onTriggered: timeline.setClipStatus(clipId, 3)
}
}
}
......@@ -234,7 +234,12 @@ Item {
compositionRoot.clicked(compositionRoot, false)
}
}
onClicked: menu.show()
onClicked: {
compositionMenu.clipId = compositionRoot.clipId
compositionMenu.grouped = compositionRoot.grouped
compositionMenu.trackId = compositionRoot.trackId
compositionMenu.popup()
}
}
}
......@@ -350,75 +355,4 @@ Item {
color: 'white'
}
}
Menu {
id: menu
function show() {
//mergeItem.visible = timeline.mergeClipWithNext(trackIndex, index, true)
popup()
}
MenuItem {
text: i18n('Cut')
onTriggered: {
if (!parentTrack.isLocked) {
timeline.copyClip(trackIndex, index)
timeline.remove(trackIndex, index)
} else {
root.pulseLockButtonOnTrack(currentTrack)
}
}
}
MenuItem {
visible: !grouped && parentTrack.selection.length > 1
text: i18n('Group')
onTriggered: timeline.groupSelection()
}
MenuItem {
visible: grouped
text: i18n('Ungroup')
onTriggered: timeline.unGroupSelection(clipId)
}
MenuItem {
visible: true
text: i18n('Copy')
onTriggered: timeline.copyClip(parentTrack.trackId, index)
}
MenuSeparator {
visible: !isComposition
}
MenuItem {
text: i18n('Remove')
onTriggered: timeline.triggerAction('delete_timeline_clip')
}
MenuItem {
visible: true
text: i18n('Lift')
onTriggered: timeline.lift(parentTrack.trackId, index)
}
MenuSeparator {
visible: true
}
MenuItem {
visible: true
text: i18n('Split At Playhead (S)')
onTriggered: timeline.splitClip(parentTrack.trackId, index)
}
MenuItem {
id: mergeItem
text: i18n('Merge with next clip')
onTriggered: timeline.mergeClipWithNext(parentTrack.trackId, index, false)
}
MenuItem {
visible: !isComposition
text: i18n('Rebuild Audio Waveform')
onTriggered: timeline.remakeAudioLevels(parentTrack.trackId, index)
}
/*onPopupVisibleChanged: {
if (visible && application.OS !== 'OS X' && __popupGeometry.height > 0) {
// Try to fix menu running off screen. This only works intermittently.
menu.__yOffset = Math.min(0, Screen.height - (__popupGeometry.y + __popupGeometry.height + 40))
menu.__xOffset = Math.min(0, Screen.width - (__popupGeometry.x + __popupGeometry.width))
}
}*/
}
}
import QtQuick 2.6
import QtQuick.Controls 1.4
Menu {
id: compositionMenu
property int clipId
property int clipStatus
property int trackId
property bool grouped
function show() {
//mergeItem.visible = timeline.mergeClipWithNext(trackIndex, index, true)
popup()
}
MenuItem {
text: i18n('Cut')
onTriggered: {
if (!parentTrack.isLocked) {
timeline.copyClip(trackId, index)
timeline.remove(trackId, index)
} else {
root.pulseLockButtonOnTrack(trackId)
}
}
}
MenuItem {
visible: !grouped && timeline.selection.length > 1
text: i18n('Group')
onTriggered: timeline.groupSelection()
}
MenuItem {
visible: grouped
text: i18n('Ungroup')
onTriggered: timeline.unGroupSelection(clipId)
}
MenuItem {
visible: true
text: i18n('Copy')
onTriggered: root.copiedClip = clipId
}
MenuSeparator {
visible: !isComposition
}
MenuItem {
text: i18n('Remove')
onTriggered: timeline.triggerAction('delete_timeline_clip')
}
MenuItem {
visible: true
text: i18n('Lift')
onTriggered: timeline.extract(clipId)
}
MenuSeparator {
visible: true
}
MenuItem {
visible: true
text: i18n('Split At Playhead (S)')
onTriggered: timeline.triggerAction('cut_timeline_clip')
}
}
......@@ -23,6 +23,12 @@ Rectangle {
id: fontMetrics
font.family: "Arial"
}
ClipMenu {
id: clipMenu
}
CompositionMenu {
id: compositionMenu
}
function moveSelectedTrack(offset) {
var cTrack = Logic.getTrackIndexFromId(timeline.activeTrack)
......
......@@ -20,6 +20,8 @@
<file alias="Clip.qml">timeline2/view/qml/Clip.qml</file>
<file alias="KeyframeView.qml">timeline2/view/qml/KeyframeView.qml</file>
<file alias="Composition.qml">timeline2/view/qml/Composition.qml</file>
<file alias="ClipMenu.qml">timeline2/view/qml/ClipMenu.qml</file>
<file alias="CompositionMenu.qml">timeline2/view/qml/CompositionMenu.qml</file>
<file alias="PulsingAnimation.qml">timeline2/view/qml/PulsingAnimation.qml</file>
<file alias="CornerSelectionShadow.qml">timeline2/view/qml/CornerSelectionShadow.qml</file>
<file alias="Timeline.js">timeline2/view/qml/Timeline.js</file>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment