I am using QT6 (6.5.2)
-
I am using QT 6
import QtQuick 6.4 import 'popup' as Popup Component { id: screenConnection Item { anchors.fill : screenConnection Component.onCompleted: screens.openProgress() } }ERROR AS WARING:
Using a Component as the root of a QML document is deprecated: types defined in qml documents are automatically wrapped into Components when needed. -
I am using QT 6
import QtQuick 6.4 import 'popup' as Popup Component { id: screenConnection Item { anchors.fill : screenConnection Component.onCompleted: screens.openProgress() } }ERROR AS WARING:
Using a Component as the root of a QML document is deprecated: types defined in qml documents are automatically wrapped into Components when needed.@srinath_ramamoorthy Do you have a question?
-
@srinath_ramamoorthy Do you have a question?
@jsulm yes for sure ,How can I avoid this warning ?
-
@jsulm yes for sure ,How can I avoid this warning ?
@srinath_ramamoorthy Don't use Component as root element
-
@srinath_ramamoorthy Don't use Component as root element
-
@jsulm So what should we use as the root element instead? for example inside a delegate for listview?
-
@Maxino Item as in the example on the Component page perhaps.
@ChrisW67 can you provide an example for above mentioned code
I have tried it It is not working for me
import QtQuick 6.4 import 'popup' as Popup /******************************************************************************* * Implementation. ******************************************************************************/ Item { Component { id: screenConnection anchors.fill : screenConnection Component.onCompleted: screens.openProgress() } }or
Item { Component { id: screenConnection { anchors.fill : screenConnection Component.onCompleted: screens.openProgress() } } } -
@ChrisW67 can you provide an example for above mentioned code
I have tried it It is not working for me
import QtQuick 6.4 import 'popup' as Popup /******************************************************************************* * Implementation. ******************************************************************************/ Item { Component { id: screenConnection anchors.fill : screenConnection Component.onCompleted: screens.openProgress() } }or
Item { Component { id: screenConnection { anchors.fill : screenConnection Component.onCompleted: screens.openProgress() } } }@srinath_ramamoorthy said in I am using QT6 (6.5.2):
is not working for me
How about telling us what exactly does not work?
-
@srinath_ramamoorthy said in I am using QT6 (6.5.2):
is not working for me
How about telling us what exactly does not work?
@jsulm if I use item before component my program is not running can you give me an example ? how can I fix this
-
@jsulm if I use item before component my program is not running can you give me an example ? how can I fix this
@srinath_ramamoorthy I believe that you do not need
Componenthere. Just remove it and see if that resolves your issue. -
@srinath_ramamoorthy I believe that you do not need
Componenthere. Just remove it and see if that resolves your issue. -
C Christian Ehrlicher moved this topic from General and Desktop on
-
@Bob64 I have the same problem:
If I just use an Item without the Component, the ListView ist olny showing the last element from the ListModel.