This warning category is spelled [syntax] by qmllint.
You defined an inline component inside another inline component.
The QML language does not allow nested inline components. Always define inline components inside the root item of the QML file.
import QtQuick
Item {
component Correct: Item {
component Evil: Item { ... }
...
}
}
To fix this warning, move all components to the root item of the QML file.
import QtQuick
Item {
component NotEvilAnymore: Item { ... }
component Correct: Item {
...
}
}
You defined an inline component with an invalid base type.
Inline components need a base type to inherit from.
import QtQuick Item { property Item someProperty component InlineComponent: someProperty {} }
In this case, someProperty is not a valid type name, as it is a property name. To fix this warning, use a valid Type as the component's base type:
import QtQuick
Item {
property Item someProperty
component InlineComponent: Item { ... }
}
You defined a property alias without its aliased property.
Alias properties always need to have their aliased property or id in their definition.
import QtQuick Item { id: root property int someProperty property alias aliasProperty }
To fix this warning, replace the alias with a normal property, or add the missing aliased property:
import QtQuick Item { id: root property int someProperty property alias withAliasedProperty: root.someProperty }
You defined a property alias that aliases an expression other than an ID or a field member expression.
A field member expression is an expression of the form someId.someProperty.
Alias properties always need to have their aliased property in their definition, and can't bind to other expressions than IDs and field member expressions.
import QtQuick Item { property int p property alias someProperty: p + 1 }
To fix this warning, replace the alias with a normal property or bind it to an id or field member expression:
import QtQuick Item { id: root property int p property int someProperty: p + 1 property alias alternative: root.p }
You defined an id without a value.
The QML language does not allow empty ids.
import QtQuick Item { id:; }
To fix this warning, bind the id to a valid name:
import QtQuick Item { id: root; }
You bound an id to an expression other than a name.
The QML language only allows names as bindings to ids; more complex expressions can't be used.
import QtQuick Item { property int a property int b function f() { if (true) return a return b } id: f() }
To fix this warning, bind the id to a valid name or declare a property and set up a binding:
import QtQuick Item { property int a property int b function f() { if (true) return a return b } id: someItem // it would be confusing to call it `f` like the function property int alternative: f() }
You added an expression other than an object into a list of objects.
The QML language only allows objects in object lists.
import QtQuick Item { property int hello property list<Item> myList: [ Item {}, hello{} ] }
To fix this warning, use a valid object type, or remove the item from the list:
import QtQuick Item { component Hello: Item {} property list<Item> myList: [ Item {}, Hello{} ] }
You defined an enum inside an inline component.
The QML language only allows enum definitions inside the root item of the QML file. Enums declared inside an inline component are unusable, even inside the inline component. The same applies to enums declared inside non-root QML objects.
import QtQuick Item { component MyInlineComponent: Item { enum MyEnum { Hello, World } } }
To fix this warning, move the enum declaration into the root element of the QML file:
import QtQuick Item { enum MyEnum { Hello, World } component MyInlineComponent: Item { } }
You specified an invalid argument to a pragma.
The pragma will have no effect.
pragma ComponentBehavior: Buond
import QtQuick
Item {
}
You can fix this warning by removing the pragma or fixing a potential typo:
pragma ComponentBehavior: Bound
import QtQuick
Item {
}