qt: invalid property name 'x' (M16) for button

后端 未结 3 1794
忘掉有多难
忘掉有多难 2021-02-08 04:06

I\'m using Qt 5.4.1 in QtCreator 3.3.1

I\'ve imported QtQuick.Controls 1.2 into my QML and added a series of buttons:

Rectangle {
    id: buttonBar
    x         


        
相关标签:
3条回答
  • 2021-02-08 04:10

    Try to add import QtQuick.Window 2.2 before all other imports in qml.

    0 讨论(0)
  • 2021-02-08 04:20

    I moved these imports to the top, before any other import and problem got resovled:

    import QtQml.Models 2.2
    import QtQml 2.2
    
    0 讨论(0)
  • 2021-02-08 04:23

    It's a bug in the type info that is generated for controls for use of Qt Creator.

    To suppress this error, add comment:

    Button {
        // @disable-check M16
        x: 80
        y: 0
    }
    
    0 讨论(0)
提交回复
热议问题