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. Unknown component. (M300) for inline components
Forum Updated to NodeBB v4.3 + New Features

Unknown component. (M300) for inline components

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 185 Views 1 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.
  • beeckscheB Offline
    beeckscheB Offline
    beecksche
    wrote on last edited by beecksche
    #1

    Hi,
    for Inline Components that are defined in another file, I get the error message in QtCreator (8.0.1): Unknown Component. (M300).
    Bute the code runs without errors.

    main.qml

    import QtQuick 2.15
    import QtQuick.Window 2.15
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
        Test.MyRectangle {
            anchors.centerIn: parent
        }
    }
    

    Test.qml

    import QtQuick 2.15
    
    Item {
        component MyRectangle : Rectangle {
            width: 200
            height: 300
            color: "red"
        }
    }
    

    code.JPG

    app.JPG

    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