Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.8.0
-
Tried it on windows, also will try it on ubuntu
Description
Hi,
I have a popup control which has combobox in its contentItem.
And In this combobox I have a indicator:Canvas.
When popup seen on the screen , I click outside the popup and it is closed.After that when I try to open the combobox again, I dont see indicator on combobox and getting following warning in console:
file:///C:/Users/cjs330/Documents/QT/Raspberry/RaspiComponents/RaspiMainMenuComboBox.qml:36: TypeError: Cannot call method 'reset' of null
Here is minimal QML code that can reproduce the issue without Qt Quick Controls 2:
main.qml
import QtQuick 2.0 import QtQuick.Window 2.0 Window { id: window width: 400 height: 400 visible: true title: "QTBUG-61334" Canvas { id: canvas width: 12 height: 8 contextType: "2d" onAvailableChanged: print("available", available) onContextChanged: print("context", context) Timer { running: true interval: 1000 repeat: true onTriggered: { canvas.parent = canvas.parent ? null : window.contentItem } } onPaint: { context.reset(); context.moveTo(0, 0); context.lineTo(width, 0); context.lineTo(width / 2, height); context.closePath(); context.fillStyle = "#21be2b"; context.fill(); } } }
See qtbug61334.zip for a project containing the original QML.
Regards
Attachments
Issue Links
- relates to
-
QTBUG-73113 Crash when reparenting QML Canvas items
- Closed