Unsolved QML ToolBar: Binding loop detected for property "implicitHeight"
-
Hi All,
I get this issue for ToolBar
QML ToolBar: Binding loop detected for property "implicitHeight"
ToolBar {
id: titleBar
RowLayout {
anchors.fill: parent
ToolButton {
action: dirUpAction
style: IconButtonStyle { }
Layout.maximumWidth: height * 1.5
}
TextField {
id: currentPathField
Layout.fillWidth: true
function doAccept() {
root.clearSelection()
if (root.addSelection(root.pathToUrl(text)))
root.accept()
else
root.folder = root.pathFolder(text)
}
onAccepted: doAccept()
}
}
}How can i fix this?
-
@sush123 hi
Are you sure the error comes from this code? I have no error when i test this.
what is your Qt and QtQuick.Controls version ?import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Window 2.12 import QtQuick.Layouts 1.3 Window { visible: true width: 300 height: 300 ToolBar { id: titleBar width: parent.width RowLayout { anchors.fill: parent ToolButton { Layout.maximumWidth: height * 1.5 } TextField { id: currentPathField Layout.fillWidth: true function doAccept() { root.clearSelection() if (root.addSelection(root.pathToUrl(text))) root.accept() else root.folder = root.pathFolder(text) } onAccepted: doAccept() } } } }
#include <QGuiApplication> #include <QQmlApplicationEngine> #include <QApplication> int main(int argc, char *argv[]) { QApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }
i have Qt 5.14.0
-
Hi ,
when i click on file:///C:/Qt/5.12.8/msvc2017_64/qml/QtQuick/Dialogs/DefaultFileDialog.qml:407:9: QML ToolBar: Binding loop detected for property "implicitHeight"it goes to C:\Qt\5.12.8\msvc2017_64\qml\QtQuick\Dialogs\DefaultFileDialog.qml file.
i have Qt 5.12.8
-
@sush123 can you try to run the example i sent to you ?