title: Dynamic update of QTextBrowser in a Qdialog from a file(that gets updated by another job)
body: <p>I have a log file that gets updated while the job is running. I want the text content displayed in the text browser, and that should be updated dynamically. </p>
  
  <p><strong>.h file</strong>   </p>
  
  <pre><code>public:
  
      void fillloginfo();
  
      void initializeQTimer();
  
      void closeEvent(QCloseEvent *event);
  
      void fillLogInfoChronically(const QString&amp; logFilePath);
  
  private:
  
      QTimer* m_Timer;
  
      QString m_logFilePath;
  
      std::ifstream m_logFileStream;
  
  public slots:
  
      void fillLogInfoChronicallySlot();
  </code></pre>
  
  <p><strong>.cpp file</strong></p>
  
  <pre><code>void logdialog::initializeQTimer(){
  
      m_Timer = NULL;
  
      //create the timer object
      m_Timer = new QTimer(this);
  
      QObject::connect(m_Timer,SIGNAL(timeout()), this,SLOT(fillLogInfoChronicallySlot()));
  
   }
  
  void logdialog::closeEvent(QCloseEvent *event)
  {
      m_Timer-&gt;stop();
  
      if ( m_logFileStream.is_open()){
           m_logFileStream.close();
      }
  }
  
  
  
  void logdialog::fillLogInfoChronically(const QString &amp;logFilePath)
  {
      uilog-&gt;textBrowser-&gt;clear();
  
      m_LastLinePos = 0;
  
      m_logFilePath = logFilePath;
  
      std::string m_logFilePathStr= m_logFilePath.toStdString();
      m_logFileStream.open(m_logFilePathStr.c_str());
  
      if (m_logFileStream.is_open()){
  
          fillloginfo();
  
          m_Timer-&gt;start(1000);
      }
  }
  
  void logdialog::fillloginfo()
  {
      std::string line;
      while (getline(m_logFileStream,line)){
          uilog-&gt;textBrowser-&gt;append(QString::fromStdString(line));
      }  
  }
  
  void logdialog::fillLogInfoChronicallySlot()
  {
      fillloginfo();
  }
  </code></pre>
  
  <p>So, I am able to read the file only on the first call, rest of the calls to get an update from the file are not working.</p>
  
  <p>Thanks in advance</p>