Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. error with qml
Forum Updated to NodeBB v4.3 + New Features

error with qml

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 506 Views
  • 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.
  • V Offline
    V Offline
    vale88
    wrote on last edited by vale88
    #1

    import QtQuick 2.4
    import QtQuick.Extras 1.4
    import QtQuick.Controls.Styles.Desktop 1.0
    import Qt.labs.qmlmodels 1.0
    import QtQuick.Shapes 1.11
    import QtCanvas3D 1.1

    Rectangle {

    id: rectangle
    
    width:400
    
    height: 400
    
    
    
    
    
    //transformOrigin: Item.Left
    
    
    
    
    
    CircularGauge {
        id: circularGauge
        y: 60
        anchors.left: parent.left
        anchors.leftMargin: 96
    }
    

    }

    but I have an error:
    StyleItem is not a type
    and
    qrc:/QMl.qml: Type RowItemSingleton unavailable

    and I have:

    Cattura.PNG

    ODБOïO 1 Reply Last reply
    0
    • V vale88

      import QtQuick 2.4
      import QtQuick.Extras 1.4
      import QtQuick.Controls.Styles.Desktop 1.0
      import Qt.labs.qmlmodels 1.0
      import QtQuick.Shapes 1.11
      import QtCanvas3D 1.1

      Rectangle {

      id: rectangle
      
      width:400
      
      height: 400
      
      
      
      
      
      //transformOrigin: Item.Left
      
      
      
      
      
      CircularGauge {
          id: circularGauge
          y: 60
          anchors.left: parent.left
          anchors.leftMargin: 96
      }
      

      }

      but I have an error:
      StyleItem is not a type
      and
      qrc:/QMl.qml: Type RowItemSingleton unavailable

      and I have:

      Cattura.PNG

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by ODБOï
      #2

      @vale88

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.12
      import QtQuick.Extras 1.4 
      
      ApplicationWindow {
          id: root
          width: 800
          height: 600
          visible: true
      
          CircularGauge {
              id: circularGauge
              y: 60
              anchors.left: parent.left
              anchors.leftMargin: 96
          }
      }
      

      @vale88 said in error with qml:

      StyleItem

      What is StyleItem ? There is no ref to StyleItem in the code you pasted here. In your qt creator application output tab you should see the line in your code where the error occured

      note: please try to format/ indent you code correctly before you past it, huge spaces around a commented line is fully useless
      please try to provide some explanation with human words about what you are trying to achieve

      V 1 Reply Last reply
      2
      • ODБOïO ODБOï

        @vale88

        import QtQuick 2.12
        import QtQuick.Window 2.12
        import QtQuick.Controls 2.12
        import QtQuick.Extras 1.4 
        
        ApplicationWindow {
            id: root
            width: 800
            height: 600
            visible: true
        
            CircularGauge {
                id: circularGauge
                y: 60
                anchors.left: parent.left
                anchors.leftMargin: 96
            }
        }
        

        @vale88 said in error with qml:

        StyleItem

        What is StyleItem ? There is no ref to StyleItem in the code you pasted here. In your qt creator application output tab you should see the line in your code where the error occured

        note: please try to format/ indent you code correctly before you past it, huge spaces around a commented line is fully useless
        please try to provide some explanation with human words about what you are trying to achieve

        V Offline
        V Offline
        vale88
        wrote on last edited by
        #3

        @LeLev said in error with qml:

        import QtQuick 2.12
        import QtQuick.Window 2.12
        import QtQuick.Controls 2.12
        import QtQuick.Extras 1.4

        ApplicationWindow {
        id: root
        width: 800
        height: 600
        visible: true

        CircularGauge {
            id: circularGauge
            y: 60
            anchors.left: parent.left
            anchors.leftMargin: 96
        }
        

        }

        I have an error

        QML debugging is enabled. Only use this in a safe environment.
        QQuickWidget does not support using windows as a root item. 
        
        If you wish to create your root window from QML, consider using QQmlApplicationEngine instead. 
        

        I wrote like you wrote..when two screens open, in one there is mainwindow, and on the other qml..I want it opens in mainwindow

        I wrote:

         ui->quickWidget->setSource(QUrl("qrc:///qml.qml"));
        
        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