Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. application hang
Forum Updated to NodeBB v4.3 + New Features

application hang

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 4 Posters 1.2k Views 3 Watching
  • 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.
  • ODБOïO Offline
    ODБOïO Offline
    ODБOï
    wrote on last edited by
    #1

    hi, im trying to read a big (10MB, 300K lines) text file and display it inside a QML TextArea, the reading method is running in separate thread, but after 15 - 20 seconds the application hangs.
    im reading the file into a QString..

    ...
     Q_PROPERTY (QString fileContent  ...
    ...
     QFile file(filepath);
            if (file.open(QFile::ReadOnly))
            {
                if(!items.isEmpty())
                items.clear();
              
                float totalLineCount = 0;
                QTextStream code(&file);
                while ((code.atEnd() == false))
                {
                    totalLineCount++;
                    fileContent +=  code.readLine();
                    fileContent+= "\n";
                }
    
    
    

    the biggest files i can load in an acceptable time is a file of 2MB / 30 second
    What are my options to be able to read bigger files quicker and show in QML?
    thank you

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by JKSH
      #2

      @LeLev said in application hang:

      the reading method is running in separate thread, but after 15 - 20 seconds the application hangs.

      How do you run the method in a separate thread?

       Q_PROPERTY (QString fileContent  ...
      ...
       QFile file(filepath);
              if (file.open(QFile::ReadOnly))
              {
                  ...
                  float totalLineCount = 0;
                  QTextStream code(&file);
                  while ((code.atEnd() == false))
                  {
                      totalLineCount++;
                      fileContent +=  code.readLine();
                      fileContent+= "\n";
                  }
      

      See if this is any faster:

      QFile file(filepath);
      if (file.open(QFile::ReadOnly|QFile::Text))
      {
          QByteArray contents = file.readAll();
          int totalLineCount = contents.count('\n') + 1;
          fileContent = QString::fromUtf8(contents); // or fromLocal8Bit(), depending on your file encoding
      }
      

      P.S. Why is totalLineCount a float? You can't any fractions!

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      ODБOïO 1 Reply Last reply
      2
      • JKSHJ JKSH

        @LeLev said in application hang:

        the reading method is running in separate thread, but after 15 - 20 seconds the application hangs.

        How do you run the method in a separate thread?

         Q_PROPERTY (QString fileContent  ...
        ...
         QFile file(filepath);
                if (file.open(QFile::ReadOnly))
                {
                    ...
                    float totalLineCount = 0;
                    QTextStream code(&file);
                    while ((code.atEnd() == false))
                    {
                        totalLineCount++;
                        fileContent +=  code.readLine();
                        fileContent+= "\n";
                    }
        

        See if this is any faster:

        QFile file(filepath);
        if (file.open(QFile::ReadOnly|QFile::Text))
        {
            QByteArray contents = file.readAll();
            int totalLineCount = contents.count('\n') + 1;
            fileContent = QString::fromUtf8(contents); // or fromLocal8Bit(), depending on your file encoding
        }
        

        P.S. Why is totalLineCount a float? You can't any fractions!

        ODБOïO Offline
        ODБOïO Offline
        ODБOï
        wrote on last edited by ODБOï
        #3

        hi, thx for the answer
        @JKSH said in application hang:

        How do you run the method in a separate thread?

        with QtConcurrentRun

        @JKSH said in application hang:

        See if this is any faster:

        thak you!
        i will have to adapt it because the code i pasted is simplified, In the real code, the QTextStream is used later like here, may i ask how would you iterate over fileContent or contents line by line in the second loop ?

        void preProcessFile(QString filepath)
        {
            QFile file(filepath);
            if (file.open(QFile::ReadOnly))
            {
                qDebug()<< "file found";
               if(!items.isEmpty())
                items.clear();
        
                setSource(QString(""));
                setLoading(true);
        
                QString fileContent("");
        
                float totalLineCount = 0;
                QTextStream code(&file);
                while ((code.atEnd() == false))
                {
                    totalLineCount++;
                    fileContent +=  code.readLine();
                    fileContent+= "\n";
                }
                if (totalLineCount == 0)
                    totalLineCount = 1;
        
                code.seek(0);
        
                double x = 0;
                double y = 0;
                double i = 0;
                double j = 0;
                bool arc = false;
                bool cw = false;
                bool mm = true;
                int index = 0;
                int g = 0;
        
                bool zeroInsert = false;
                do
                {
                    QString strline = code.readLine();
        
                    index++;
        
                    trimToEnd(strline, '(');
                    trimToEnd(strline, ';');
                    trimToEnd(strline, '%');
                    strline = strline.trimmed();
        
                    if (strline.size() == 0)
                    {....}//ignore comments
                    else
                    {
                    ....
                    }
                } while (code.atEnd() == false);
        
            }
            else
                return
        }
        

        @JKSH said in application hang:

        Why is totalLineCount a float? You can't any fractions!

        in the lib i use its is type of float, i found it strange also

        JKSHJ 1 Reply Last reply
        0
        • ODБOïO ODБOï

          hi, thx for the answer
          @JKSH said in application hang:

          How do you run the method in a separate thread?

          with QtConcurrentRun

          @JKSH said in application hang:

          See if this is any faster:

          thak you!
          i will have to adapt it because the code i pasted is simplified, In the real code, the QTextStream is used later like here, may i ask how would you iterate over fileContent or contents line by line in the second loop ?

          void preProcessFile(QString filepath)
          {
              QFile file(filepath);
              if (file.open(QFile::ReadOnly))
              {
                  qDebug()<< "file found";
                 if(!items.isEmpty())
                  items.clear();
          
                  setSource(QString(""));
                  setLoading(true);
          
                  QString fileContent("");
          
                  float totalLineCount = 0;
                  QTextStream code(&file);
                  while ((code.atEnd() == false))
                  {
                      totalLineCount++;
                      fileContent +=  code.readLine();
                      fileContent+= "\n";
                  }
                  if (totalLineCount == 0)
                      totalLineCount = 1;
          
                  code.seek(0);
          
                  double x = 0;
                  double y = 0;
                  double i = 0;
                  double j = 0;
                  bool arc = false;
                  bool cw = false;
                  bool mm = true;
                  int index = 0;
                  int g = 0;
          
                  bool zeroInsert = false;
                  do
                  {
                      QString strline = code.readLine();
          
                      index++;
          
                      trimToEnd(strline, '(');
                      trimToEnd(strline, ';');
                      trimToEnd(strline, '%');
                      strline = strline.trimmed();
          
                      if (strline.size() == 0)
                      {....}//ignore comments
                      else
                      {
                      ....
                      }
                  } while (code.atEnd() == false);
          
              }
              else
                  return
          }
          

          @JKSH said in application hang:

          Why is totalLineCount a float? You can't any fractions!

          in the lib i use its is type of float, i found it strange also

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @LeLev said in application hang:

          with QtConcurrentRun

          Please show your code.

          Did you apply QtConcurrent::run() to a QObject's class method? If so, have you made your method is thread-safe?

          @LeLev said in application hang:

          In the real code, the QTextStream is used later like here, may i ask how would you iterate over fileContent or contents line by line in the second loop ?

          QTextStream can operate on a QByteArray* or QString*. I'm guessing that both of these options are faster than operating on a QFile* (but please benchmark to make sure)

          in the lib i use its is type of float, i found it strange also

          I see. There's not much we can do, then :)

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          ODБOïO 1 Reply Last reply
          2
          • JKSHJ JKSH

            @LeLev said in application hang:

            with QtConcurrentRun

            Please show your code.

            Did you apply QtConcurrent::run() to a QObject's class method? If so, have you made your method is thread-safe?

            @LeLev said in application hang:

            In the real code, the QTextStream is used later like here, may i ask how would you iterate over fileContent or contents line by line in the second loop ?

            QTextStream can operate on a QByteArray* or QString*. I'm guessing that both of these options are faster than operating on a QFile* (but please benchmark to make sure)

            in the lib i use its is type of float, i found it strange also

            I see. There's not much we can do, then :)

            ODБOïO Offline
            ODБOïO Offline
            ODБOï
            wrote on last edited by ODБOï
            #5

            @JKSH said in application hang:

            Please show your code.

            showPreviews is public slot of my class (classe base is QQuickPaintedItem)
            it is running the preProcessFile() method with QtConcurrentRun
            but preProcessFile() is accessing the member variable (items) of the class (is that a problem ?)

             void showPreviews(QString path){ // this is a public slot
                    qDebug()<<"loading the file for the preview" << path;
                    QFile file(path);
                    if(!file.exists()){
                        qDebug()<<"fichier introuvable..";
                    }
            
                    QtConcurrent::run([=]{
                              preProcessFile(path);
                          });
            // before i knew  QtConcurrent::run i dit with QThread::create
            //        QThread *thread = QThread::create([=]{ preProcessFile(path);});
            //        QObject::connect(thread,&QThread::finished,thread,&QThread::deleteLater);
            //        QObject::connect(thread,&QThread::destroyed,[](){qDebug()<<"thread Deleted";});
            //        thread->start();
            
                }
            
            
              void preProcessFile(QString filepath)
                {
                    QFile file(filepath);
                    if (file.open(QFile::ReadOnly))
                    {
                        qDebug()<< "file found";
                       if(!items.isEmpty())
                        items.clear();
            
                        setSource(QString(""));
                        setLoading(true);
            
                        QString fileContent("");
            
                        float totalLineCount = 0;
                        QTextStream code(&file);
                        while ((code.atEnd() == false))
                        {
                            totalLineCount++;
                            fileContent +=  code.readLine();
                            fileContent+= "\n";
                        }
                        if (totalLineCount == 0)
                            totalLineCount = 1;
            
                        code.seek(0);
            
                        double x = 0;
                        double y = 0;
                        double i = 0;
                        double j = 0;
                        bool arc = false;
                        bool cw = false;
                        bool mm = true;
                        int index = 0;
                        int g = 0;
            
                        bool zeroInsert = false;
                        do
                        {
                            QString strline = code.readLine();
            
                            index++;
            
                            trimToEnd(strline, '(');
                            trimToEnd(strline, ';');
                            trimToEnd(strline, '%');
            
                            strline = strline.trimmed();
            
                            if (strline.size() == 0)
                            {}//ignore comments
                            else
                            {
                                strline = strline.toUpper();
                                strline.replace("M6", "M06");
                                strline.replace(QRegExp("([A-Z])"), " \\1");
                                strline.replace(QRegExp("\\s+"), " ");
                                //if (strline.contains("G", Qt::CaseInsensitive))
                                {
                                    if (processGCode(strline, x, y, i, j, arc, cw, mm, g))
                                    {
                                        if (!zeroInsert)
                                        {
                                            // insert 0,0 position
                                            items.append(PosItem(0, 0, 0, 0, false, false, mm, 0)); // member access
                                            zeroInsert = true;
                                        }
                                        items.append(PosItem(x, y, i, j, arc, cw, mm, index));
                                    }
                                }
                            }
                        } while (code.atEnd() == false);
                        setItems(items);
                        file.close();
                        setSource(fileContent);
                        setLoading(false);
                       
                    }
                    else
                        printf("Can't open file\n");
                }
            

            @JKSH said in application hang:

            have you made your method is thread-safe?

            no.. all i did is to make the member functions calls pass through Signal/Slots
            instead of calling update() i created a signal doUpdate()

            and i use Signal/Slots to handle it thread-safely
            i will do the same for other method calls (eg processGCode(),trimToEnd() )
            and also for the member access ( eg. items.append(PosItem(x, y, i, j, arc, cw, mm, index)); )

            kshegunovK JKSHJ 2 Replies Last reply
            0
            • ODБOïO ODБOï

              @JKSH said in application hang:

              Please show your code.

              showPreviews is public slot of my class (classe base is QQuickPaintedItem)
              it is running the preProcessFile() method with QtConcurrentRun
              but preProcessFile() is accessing the member variable (items) of the class (is that a problem ?)

               void showPreviews(QString path){ // this is a public slot
                      qDebug()<<"loading the file for the preview" << path;
                      QFile file(path);
                      if(!file.exists()){
                          qDebug()<<"fichier introuvable..";
                      }
              
                      QtConcurrent::run([=]{
                                preProcessFile(path);
                            });
              // before i knew  QtConcurrent::run i dit with QThread::create
              //        QThread *thread = QThread::create([=]{ preProcessFile(path);});
              //        QObject::connect(thread,&QThread::finished,thread,&QThread::deleteLater);
              //        QObject::connect(thread,&QThread::destroyed,[](){qDebug()<<"thread Deleted";});
              //        thread->start();
              
                  }
              
              
                void preProcessFile(QString filepath)
                  {
                      QFile file(filepath);
                      if (file.open(QFile::ReadOnly))
                      {
                          qDebug()<< "file found";
                         if(!items.isEmpty())
                          items.clear();
              
                          setSource(QString(""));
                          setLoading(true);
              
                          QString fileContent("");
              
                          float totalLineCount = 0;
                          QTextStream code(&file);
                          while ((code.atEnd() == false))
                          {
                              totalLineCount++;
                              fileContent +=  code.readLine();
                              fileContent+= "\n";
                          }
                          if (totalLineCount == 0)
                              totalLineCount = 1;
              
                          code.seek(0);
              
                          double x = 0;
                          double y = 0;
                          double i = 0;
                          double j = 0;
                          bool arc = false;
                          bool cw = false;
                          bool mm = true;
                          int index = 0;
                          int g = 0;
              
                          bool zeroInsert = false;
                          do
                          {
                              QString strline = code.readLine();
              
                              index++;
              
                              trimToEnd(strline, '(');
                              trimToEnd(strline, ';');
                              trimToEnd(strline, '%');
              
                              strline = strline.trimmed();
              
                              if (strline.size() == 0)
                              {}//ignore comments
                              else
                              {
                                  strline = strline.toUpper();
                                  strline.replace("M6", "M06");
                                  strline.replace(QRegExp("([A-Z])"), " \\1");
                                  strline.replace(QRegExp("\\s+"), " ");
                                  //if (strline.contains("G", Qt::CaseInsensitive))
                                  {
                                      if (processGCode(strline, x, y, i, j, arc, cw, mm, g))
                                      {
                                          if (!zeroInsert)
                                          {
                                              // insert 0,0 position
                                              items.append(PosItem(0, 0, 0, 0, false, false, mm, 0)); // member access
                                              zeroInsert = true;
                                          }
                                          items.append(PosItem(x, y, i, j, arc, cw, mm, index));
                                      }
                                  }
                              }
                          } while (code.atEnd() == false);
                          setItems(items);
                          file.close();
                          setSource(fileContent);
                          setLoading(false);
                         
                      }
                      else
                          printf("Can't open file\n");
                  }
              

              @JKSH said in application hang:

              have you made your method is thread-safe?

              no.. all i did is to make the member functions calls pass through Signal/Slots
              instead of calling update() i created a signal doUpdate()

              and i use Signal/Slots to handle it thread-safely
              i will do the same for other method calls (eg processGCode(),trimToEnd() )
              and also for the member access ( eg. items.append(PosItem(x, y, i, j, arc, cw, mm, index)); )

              kshegunovK Offline
              kshegunovK Offline
              kshegunov
              Moderators
              wrote on last edited by kshegunov
              #6

              @LeLev said in application hang:

              but preProcessFile() is accessing the member variable (items) of the class (is that a problem ?)

              Yes.

              PS. However it seems your statement is not correct - you're not touching the object from the preProcessFile function. Or if you are doing it, I'm not seeing it.

              Read and abide by the Qt Code of Conduct

              ODБOïO 1 Reply Last reply
              2
              • ODБOïO ODБOï

                @JKSH said in application hang:

                Please show your code.

                showPreviews is public slot of my class (classe base is QQuickPaintedItem)
                it is running the preProcessFile() method with QtConcurrentRun
                but preProcessFile() is accessing the member variable (items) of the class (is that a problem ?)

                 void showPreviews(QString path){ // this is a public slot
                        qDebug()<<"loading the file for the preview" << path;
                        QFile file(path);
                        if(!file.exists()){
                            qDebug()<<"fichier introuvable..";
                        }
                
                        QtConcurrent::run([=]{
                                  preProcessFile(path);
                              });
                // before i knew  QtConcurrent::run i dit with QThread::create
                //        QThread *thread = QThread::create([=]{ preProcessFile(path);});
                //        QObject::connect(thread,&QThread::finished,thread,&QThread::deleteLater);
                //        QObject::connect(thread,&QThread::destroyed,[](){qDebug()<<"thread Deleted";});
                //        thread->start();
                
                    }
                
                
                  void preProcessFile(QString filepath)
                    {
                        QFile file(filepath);
                        if (file.open(QFile::ReadOnly))
                        {
                            qDebug()<< "file found";
                           if(!items.isEmpty())
                            items.clear();
                
                            setSource(QString(""));
                            setLoading(true);
                
                            QString fileContent("");
                
                            float totalLineCount = 0;
                            QTextStream code(&file);
                            while ((code.atEnd() == false))
                            {
                                totalLineCount++;
                                fileContent +=  code.readLine();
                                fileContent+= "\n";
                            }
                            if (totalLineCount == 0)
                                totalLineCount = 1;
                
                            code.seek(0);
                
                            double x = 0;
                            double y = 0;
                            double i = 0;
                            double j = 0;
                            bool arc = false;
                            bool cw = false;
                            bool mm = true;
                            int index = 0;
                            int g = 0;
                
                            bool zeroInsert = false;
                            do
                            {
                                QString strline = code.readLine();
                
                                index++;
                
                                trimToEnd(strline, '(');
                                trimToEnd(strline, ';');
                                trimToEnd(strline, '%');
                
                                strline = strline.trimmed();
                
                                if (strline.size() == 0)
                                {}//ignore comments
                                else
                                {
                                    strline = strline.toUpper();
                                    strline.replace("M6", "M06");
                                    strline.replace(QRegExp("([A-Z])"), " \\1");
                                    strline.replace(QRegExp("\\s+"), " ");
                                    //if (strline.contains("G", Qt::CaseInsensitive))
                                    {
                                        if (processGCode(strline, x, y, i, j, arc, cw, mm, g))
                                        {
                                            if (!zeroInsert)
                                            {
                                                // insert 0,0 position
                                                items.append(PosItem(0, 0, 0, 0, false, false, mm, 0)); // member access
                                                zeroInsert = true;
                                            }
                                            items.append(PosItem(x, y, i, j, arc, cw, mm, index));
                                        }
                                    }
                                }
                            } while (code.atEnd() == false);
                            setItems(items);
                            file.close();
                            setSource(fileContent);
                            setLoading(false);
                           
                        }
                        else
                            printf("Can't open file\n");
                    }
                

                @JKSH said in application hang:

                have you made your method is thread-safe?

                no.. all i did is to make the member functions calls pass through Signal/Slots
                instead of calling update() i created a signal doUpdate()

                and i use Signal/Slots to handle it thread-safely
                i will do the same for other method calls (eg processGCode(),trimToEnd() )
                and also for the member access ( eg. items.append(PosItem(x, y, i, j, arc, cw, mm, index)); )

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                @LeLev said in application hang:

                showPreviews is public slot of my class (classe base is QQuickPaintedItem)
                it is running the preProcessFile() method with QtConcurrentRun
                but preProcessFile() is accessing the member variable (items) of the class (is that a problem ?)

                Yes, it is a problem. You have 2 different threads that can read/write a variable but the access is not protected. This is not thread-safe and it can cause data corruption. See https://doc.qt.io/qt-5/threads-reentrancy.html

                As @kshegunov pointed out, this is a race condition.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                3
                • kshegunovK kshegunov

                  @LeLev said in application hang:

                  but preProcessFile() is accessing the member variable (items) of the class (is that a problem ?)

                  Yes.

                  PS. However it seems your statement is not correct - you're not touching the object from the preProcessFile function. Or if you are doing it, I'm not seeing it.

                  ODБOïO Offline
                  ODБOïO Offline
                  ODБOï
                  wrote on last edited by ODБOï
                  #8

                  @kshegunov said in application hang:

                  However it seems your statement is not correct - you're not touching the object from the preProcessFile function

                  i do
                  items.append(PosItem(x, y, i, j, arc, cw, mm, index)); items is member, and :
                  processGCode(strline, x, y, i, j, arc, cw, mm, g) it is member method also

                  @JKSH said in application hang:

                  Yes, it is a problem. You have 2 different threads that can read/write a variable but the access is not protected. This is not thread-safe and it can cause data corruption. See https://doc.qt.io/qt-5/threads-reentrancy.html
                  As @kshegunov pointed out, this is a race condition.

                  Ok, thank you guys for the valuable advices, I will restart the whole thing from scratch and do it properly

                  1 Reply Last reply
                  0
                  • ODБOïO Offline
                    ODБOïO Offline
                    ODБOï
                    wrote on last edited by ODБOï
                    #9

                    @JKSH after reading Reentrancy and Thread-Safety i have a doubt,
                    here switchLoadingAndUpdate() is not thread safe, but if it is used only by showPreviews() it should not cause any problems no ?

                    class GCodeView :  public QQuickPaintedItem
                    {
                        Q_OBJECT
                    public:
                        GCodeView(QQuickItem *parent = 0);
                    
                    public slots:
                        void switchLoadingAndUpdate(){
                           m_loading = !m_loading; // should i do this also through signal slot ?
                          // emit newLoadingSet(!m_loading)
                           emit needUpdate()
                        }
                    
                    void showPreviews(){  
                        QtConcurrent::run([=]{
                                  switchLoading();
                              });
                        return;
                    }
                    
                    void  doUpdate(){
                      update();
                    }
                    
                      signals :
                     void needUpdate();
                    
                    protected:
                        void paint( QPainter *painterp);
                    private:
                        bool m_loading=false;
                    };
                    #endif // GCODEVIEW_H
                    
                    //ctor
                    GCodeView::GCodeView(QQuickItem *parent): QQuickPaintedItem(parent)
                    { 
                        QObject::connect(this,&GCodeView::needUpdate,this,&GCodeView::doUpdate);
                    }
                    
                    
                    jsulmJ 1 Reply Last reply
                    0
                    • ODБOïO ODБOï

                      @JKSH after reading Reentrancy and Thread-Safety i have a doubt,
                      here switchLoadingAndUpdate() is not thread safe, but if it is used only by showPreviews() it should not cause any problems no ?

                      class GCodeView :  public QQuickPaintedItem
                      {
                          Q_OBJECT
                      public:
                          GCodeView(QQuickItem *parent = 0);
                      
                      public slots:
                          void switchLoadingAndUpdate(){
                             m_loading = !m_loading; // should i do this also through signal slot ?
                            // emit newLoadingSet(!m_loading)
                             emit needUpdate()
                          }
                      
                      void showPreviews(){  
                          QtConcurrent::run([=]{
                                    switchLoading();
                                });
                          return;
                      }
                      
                      void  doUpdate(){
                        update();
                      }
                      
                        signals :
                       void needUpdate();
                      
                      protected:
                          void paint( QPainter *painterp);
                      private:
                          bool m_loading=false;
                      };
                      #endif // GCODEVIEW_H
                      
                      //ctor
                      GCodeView::GCodeView(QQuickItem *parent): QQuickPaintedItem(parent)
                      { 
                          QObject::connect(this,&GCodeView::needUpdate,this,&GCodeView::doUpdate);
                      }
                      
                      
                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @LeLev said in application hang:

                      switchLoadingAndUpdate()

                      it changes m_loading, if m_loading is used somewhere else you still could get a race condition.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      ODБOïO 1 Reply Last reply
                      2
                      • jsulmJ jsulm

                        @LeLev said in application hang:

                        switchLoadingAndUpdate()

                        it changes m_loading, if m_loading is used somewhere else you still could get a race condition.

                        ODБOïO Offline
                        ODБOïO Offline
                        ODБOï
                        wrote on last edited by ODБOï
                        #11

                        @jsulm said in application hang:

                        used somewhere

                        in c++ ? it is only used in qml but never changed by anything. In this case it should not be a problem. I think i got it

                        GCodeView {
                        id:gView
                        }
                        BusyIndicator {
                        visible :  gView.loading
                        }
                        
                        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