Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. I am using QT6 (6.5.2)

I am using QT6 (6.5.2)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
12 Posts 6 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    srinath_ramamoorthy
    wrote on last edited by srinath_ramamoorthy
    #1

    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.

    jsulmJ 1 Reply Last reply
    1
    • S srinath_ramamoorthy

      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.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @srinath_ramamoorthy Do you have a question?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • jsulmJ jsulm

        @srinath_ramamoorthy Do you have a question?

        S Offline
        S Offline
        srinath_ramamoorthy
        wrote on last edited by
        #3

        @jsulm yes for sure ,How can I avoid this warning ?

        jsulmJ 1 Reply Last reply
        0
        • S srinath_ramamoorthy

          @jsulm yes for sure ,How can I avoid this warning ?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @srinath_ramamoorthy Don't use Component as root element

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply
          6
          • jsulmJ jsulm

            @srinath_ramamoorthy Don't use Component as root element

            M Offline
            M Offline
            Maxino
            wrote on last edited by
            #5

            @jsulm So what should we use as the root element instead? for example inside a delegate for listview?

            C 1 Reply Last reply
            0
            • M Maxino

              @jsulm So what should we use as the root element instead? for example inside a delegate for listview?

              C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              @Maxino Item as in the example on the Component page perhaps.

              S 1 Reply Last reply
              0
              • C ChrisW67

                @Maxino Item as in the example on the Component page perhaps.

                S Offline
                S Offline
                srinath_ramamoorthy
                wrote on last edited by srinath_ramamoorthy
                #7

                @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()
                        }
                     }
                }
                
                
                jsulmJ 1 Reply Last reply
                0
                • S srinath_ramamoorthy

                  @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()
                          }
                       }
                  }
                  
                  
                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @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?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  S 1 Reply Last reply
                  0
                  • jsulmJ jsulm

                    @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?

                    S Offline
                    S Offline
                    srinath_ramamoorthy
                    wrote on last edited by
                    #9

                    @jsulm if I use item before component my program is not running can you give me an example ? how can I fix this

                    B 1 Reply Last reply
                    0
                    • S srinath_ramamoorthy

                      @jsulm if I use item before component my program is not running can you give me an example ? how can I fix this

                      B Offline
                      B Offline
                      Bob64
                      wrote on last edited by
                      #10

                      @srinath_ramamoorthy I believe that you do not need Component here. Just remove it and see if that resolves your issue.

                      N 1 Reply Last reply
                      0
                      • B Bob64

                        @srinath_ramamoorthy I believe that you do not need Component here. Just remove it and see if that resolves your issue.

                        N Offline
                        N Offline
                        NewPony
                        wrote on last edited by
                        #11

                        @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.

                        N 1 Reply Last reply
                        0
                        • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
                        • N NewPony

                          @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.

                          N Offline
                          N Offline
                          NewPony
                          wrote on last edited by
                          #12

                          @NewPony
                          Ups sorry: Problem solved: I had to add the

                          ListView {
                          ...
                          spacing: <n>
                          ...
                          }
                          

                          to the ListView. The Elements where overlapped. Strange that when using Component, this is not the case.

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved