QtQuick 2.0 doesn't supported by Qt Designer in 5.2.1



  • Hello,
    I just installed Qt 5.2.1 on Windows 7 and start creating a single QML File (Qt Quick 2) with some code. When I edit this QML file in Qt Designer, it says "Use Qt Quick 1 code model instead of Qt Quick 2". Now when I start a new Qt Quick UI project instead of a single QML file (from Files and Classes), it doesn't show any error in Qt Designer. Also, it show red and yellow line in Qml file when used as a single file. Here's the code:
    // Note: The below code works fine when I run using qmlscene, but show red and yellow line.
    @import QtQuick 2.2

    Item {
    id: topItem
    width: 500
    height: 500
    Rectangle {
    width: 150
    height: 40
    border.width: 1
    border.color: Qt.hsla(.2, .4, .2, .2)
    radius: 3
    // Or use anchors.verticalCenter and anchors.horizontalCenter
    anchors.centerIn: parent
    color: Qt.rgba(.9, .2, .1, .9)

        MouseArea {
            anchors.fill: parent
            // here shows the error in cursorShape in codeEditor, but works fine when I run this code
            cursorShape: Qt.PointingHandCursor
            
        }
        Text {
            id: myBtn
            text: "<a href='http://google.com'>Click me</a>"
            textFormat: Text.RichText
            anchors.centerIn: parent
            font {
                family: "Source Sans Pro Black"
                pixelSize: 14
            }
            onLinkActivated: Qt.openUrlExternally(link);
    
        }
       
    
    }
    

    }
    @



    • Could you provide us your Cpp code(Especially where the View is)?
    • Could you try it with QtQuick 2.0?

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.