Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. TableView report binding loop detected for xxxxxx
QtWS25 Last Chance

TableView report binding loop detected for xxxxxx

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 5 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JohnDaYe
    wrote on last edited by
    #1
    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    #include <QtQuick/QQuickView>
    int main(int argc, char *argv[])
    {
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
        QQuickView::setSceneGraphBackend(QSGRendererInterface::Software);
    
        QGuiApplication app(argc, argv);
        QQmlApplicationEngine engine;
        engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
        if (engine.rootObjects().isEmpty())
            return -1;
    
        return app.exec();
    }
    
    
    import QtQuick 2.9
    import QtQuick.Window 2.2
    import QtQuick.Controls 1.4
    
    Window {
        visible: true
        width: 640
        height: 480
        color: "#00000000"
        flags: Qt.FramelessWindowHint
        title: qsTr("Hello World")
    
        ListModel {
            id: libraryModel
            ListElement {
                title: "A Masterpiece"
                author: "Gabriel"
            }
            ListElement {
                title: "Brilliance"
                author: "Jens"
            }
            ListElement {
                title: "Outstanding"
                author: "Frederik"
            }
        }
        TableView {
            id: tableView
            x: 145
            y: 221
            height: 168
            TableViewColumn {
                role: "title"
                title: "Title"
    
            }
            TableViewColumn {
                role: "author"
                title: "Author"
            }
            model: libraryModel
        }
    
        Button {
            id: button
            x: 516
            y: 132
            text: qsTr("Button")
            onClicked: {
                Qt.quit()
            }
        }
    
    }
    
    

    Qt will report information like this
    file:///E:/Qt/5.11.2/5.11.2/mingw53_32/qml/QtQuick/Controls/Private/BasicTableView.qml:615:17: QML Item: Binding loop detected for property "width"

    Qt Ver: Qt 5.11.2

    I search on internet, but i can not find any idea about this!

    T 1 Reply Last reply
    1
    • J JohnDaYe
      #include <QGuiApplication>
      #include <QQmlApplicationEngine>
      #include <QtQuick/QQuickView>
      int main(int argc, char *argv[])
      {
          QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
          QQuickView::setSceneGraphBackend(QSGRendererInterface::Software);
      
          QGuiApplication app(argc, argv);
          QQmlApplicationEngine engine;
          engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
          if (engine.rootObjects().isEmpty())
              return -1;
      
          return app.exec();
      }
      
      
      import QtQuick 2.9
      import QtQuick.Window 2.2
      import QtQuick.Controls 1.4
      
      Window {
          visible: true
          width: 640
          height: 480
          color: "#00000000"
          flags: Qt.FramelessWindowHint
          title: qsTr("Hello World")
      
          ListModel {
              id: libraryModel
              ListElement {
                  title: "A Masterpiece"
                  author: "Gabriel"
              }
              ListElement {
                  title: "Brilliance"
                  author: "Jens"
              }
              ListElement {
                  title: "Outstanding"
                  author: "Frederik"
              }
          }
          TableView {
              id: tableView
              x: 145
              y: 221
              height: 168
              TableViewColumn {
                  role: "title"
                  title: "Title"
      
              }
              TableViewColumn {
                  role: "author"
                  title: "Author"
              }
              model: libraryModel
          }
      
          Button {
              id: button
              x: 516
              y: 132
              text: qsTr("Button")
              onClicked: {
                  Qt.quit()
              }
          }
      
      }
      
      

      Qt will report information like this
      file:///E:/Qt/5.11.2/5.11.2/mingw53_32/qml/QtQuick/Controls/Private/BasicTableView.qml:615:17: QML Item: Binding loop detected for property "width"

      Qt Ver: Qt 5.11.2

      I search on internet, but i can not find any idea about this!

      T Offline
      T Offline
      Tirupathi Korla
      wrote on last edited by Tirupathi Korla
      #2

      @JohnDaYe you might have set tableview width value somewhere else in some other file. Try to search it and remove it. Also Try setting width value of tableview.

      J 1 Reply Last reply
      0
      • T Tirupathi Korla

        @JohnDaYe you might have set tableview width value somewhere else in some other file. Try to search it and remove it. Also Try setting width value of tableview.

        J Offline
        J Offline
        JohnDaYe
        wrote on last edited by
        #3

        @Tirupathi-Korla
        I try it, but do not resolved

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by
          #4

          Tried on 5.11.0. It is working fine. I just did copy-paste of your code. It could be issue with 5.11.2. Can you downgrade & check ? Or the code you pasted has some changes at your end. Please check.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          J 1 Reply Last reply
          0
          • dheerendraD dheerendra

            Tried on 5.11.0. It is working fine. I just did copy-paste of your code. It could be issue with 5.11.2. Can you downgrade & check ? Or the code you pasted has some changes at your end. Please check.

            J Offline
            J Offline
            JohnDaYe
            wrote on last edited by
            #5

            @dheerendra 5.11.0 has the same issue

            1 Reply Last reply
            0
            • dheerendraD Offline
              dheerendraD Offline
              dheerendra
              Qt Champions 2022
              wrote on last edited by
              #6

              which OS ? I tried on mac with 5.11.0. It is going good. I will try on other OS and update you.

              Dheerendra
              @Community Service
              Certified Qt Specialist
              http://www.pthinks.com

              1 Reply Last reply
              0
              • D Offline
                D Offline
                DamienL
                wrote on last edited by
                #7

                I've got the very same issue.

                void MainWindow::on_connect_triggered()
                {
                    acq = new acquisition(this);
                
                    if(acq->startAcquisition()){
                
                        foreach(CANbus * can, acq->can)
                        {
                            if(can->connectDevice()){
                
                                can->m_view = new QQuickView(can->setEngine(), window);
                                can->m_view->setSource(QUrl("qrc:/view.qml"));
                                QWidget * container = createWindowContainer(can->m_view,this);
                                ui->horizontalLayout->addWidget(container);
                
                            }
                        }
                        ui->retranslateUi(this);
                    }
                }
                
                
                
                MainWindow::on_disconnect_triggered()
                {
                
                    if(ui->horizontalLayout->count()>0){
                
                        QLayoutItem *child;
                        while ((child = ui->horizontalLayout->takeAt(0)) != 0) {
                            delete child;
                        }
                    }
                
                    ui->retranslateUi(this);
                
                    foreach(CANbus * can, acq->can)
                    {
                        QWidget *container = createWindowContainer(can->m_view,this);
                        ui->horizontalLayout->removeWidget(container);
                        can->disconnectDevice();
                        delete can;
                    }
                
                    delete acq;
                    acq = nullptr;
                }
                

                When I instantiate my QQuickView for the first time I don't have the problem. It only occurs when I reconnect my device each time after:

                file:///C:/DLI/Dev/build-testCan-Desktop_Qt_5_11_1_MinGW_32bit-Debug/debug/QtQuick/Controls/Private/BasicTableView.qml:615:17: QML Item: Binding loop detected for property "width"
                

                I have no clue how to get rid of this problem...

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  arkceajin
                  wrote on last edited by arkceajin
                  #8

                  @dheerendra
                  Using the same code, 5.10.1 find the same issue.
                  Windows 7 & mingw32

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved