Hello everyone,

after some years with QWidgets, i decided to join the "QML stream" and give QML a try.

Yet, i've run into problems i can't even really explain (is there any good Error-Handling for QML??).

Problem 1: adding a ToolButton to a ToolBar
Qt Code:
  1. import QtQuick 2.3
  2. import QtQuick.Controls 1.3
  3. import QtQuick.Layouts 1.1
  4.  
  5. ApplicationWindow {
  6. id: applicationWindow
  7. width: 800
  8. height: 600
  9. title: "test"
  10.  
  11.  
  12. toolBar: ToolBar {
  13. id: mainWindowToolbar
  14. RowLayout {
  15. id: mainWindowToolbarLayout
  16. anchors.fill: parent // problem 2
  17. }
  18. }
  19.  
  20. Component.onCompleted: {
  21. Qt.createQmlObject('import QtQuick 2.0; Rectangle {color: "red"; width: 20; height: 20}',
  22. mainWindowToolbarLayout,
  23. "TestToolButton");
  24. }
  25. }
To copy to clipboard, switch view to plain text mode 

If i (re)start the application 3 times, it crashes 2/3 times and also throws an error: "Qt.createQmlObject(): Component is not ready".
Google told me that this one of the most unrelieable error message in QML.
Which brings us to Problem #3: in the documentation of Qt.createQmlObject it states that an QtScript error is thrown, so i encapsulated the Qt.createQmlObject part into an try and catch block - yet i have no idea how to retrieve the errors from that qmlErrors() function.

Problem 2: mainWindowToolbarLayout + "anchors.fill: parent" prints the following things into the output-console:
QML Item: Binding loop detected for property "layoutHeight"
Qt Code:
  1. "qrc:/qml/MainWindowUI:16:14: QML ToolBar: Binding loop detected for property "implicitWidth""
  2. qrc:/qml/MainWindowUI:16:14: QML ToolBar: Binding loop detected for property "implicitWidth"
  3. "qrc:/qml/MainWindowUI:16:14: QML ToolBar: Binding loop detected for property "implicitWidth""
  4. qrc:/qml/MainWindowUI:16:14: QML ToolBar: Binding loop detected for property "implicitWidth"
  5. "qrc:/qml/MainWindowUI:16:14: QML ToolBar: Binding loop detected for property "implicitHeight""
  6. qrc:/qml/MainWindowUI:16:14: QML ToolBar: Binding loop detected for property "implicitHeight"
To copy to clipboard, switch view to plain text mode 
What? The documentation isn't doing anything different?

What brings us to my final question:
is there any sane way to debug such things in QML?