Results 1 to 5 of 5

Thread: QFileSystemWatcher bug?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2013
    Posts
    15
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Windows

    Default QFileSystemWatcher bug?

    Could you help me please, guys?
    I have an external application which my Qt program launch on button click. This external program write some data to the file "RES1.dat" (with FLUSH on each iteration) while it's not finished, and my program track "RES1.dat" file changes to increment progressBar:
    Qt Code:
    1. watcher->addPath("RES1.dat");
    2. connect(watcher,SIGNAL(fileChanged(QString)),this,SLOT(progressBarIncrement(QString)));
    3.  
    4. void MainWindow::progressBarIncrement(QString unused) {
    5. counter += 1; // global parameter
    6. ui->progressBar->setValue( counter );
    7. }
    To copy to clipboard, switch view to plain text mode 
    ProgressBar and external application declaration:
    Qt Code:
    1. counter=0; // global parameter
    2. ui->progressBar->setMinimum(0);
    3. ui->progressBar->setMaximum((int((datMain[5]-datMain[4])/datMain[6])+1));
    4. ui->progressBar->setValue(0);
    5.  
    6. QProcess* proc = new QProcess(this);
    7.  
    8. /* Search for .exe file */
    9. QStringList nameFilter("*.exe");
    10. QDir directory("");
    11. QStringList exeFile = directory.entryList(nameFilter);
    12. /*****************/
    13.  
    14. proc->start(exeFile[0]);
    15. connect(proc,SIGNAL(finished(int)),this,SLOT(fillPlots(int)));
    To copy to clipboard, switch view to plain text mode 
    The problem is that everything works fine on a computer where i build a programm (i have 1%,2%,...,100% progress fast and smoothly), but when i transfer my program (static build) to another computer, or even change the user on my own computer this progress goes slow and incorrect (it goes 1%,2%,...~31% and then suddenly 100%). BUT if i rebuild my programm under this user (not tested on other computers) then it goes as it should - fast and smoothly to 100%.
    So I want universal static build with correct progress, but it seems that it is correct only after rebuilding on a specific computer. What is wrong with my code, and what can I do?
    Last edited by ROCKSTAR; 3rd April 2014 at 11:51.

Similar Threads

  1. QFIleSystemWatcher
    By jayreddy in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2009, 08:21
  2. QFileSystemWatcher
    By Kumosan in forum Qt Programming
    Replies: 2
    Last Post: 18th March 2008, 20:52
  3. QFileSystemWatcher
    By minty in forum Qt Programming
    Replies: 13
    Last Post: 22nd May 2007, 15:39
  4. Need help with QFileSystemWatcher
    By L.Marvell in forum Qt Programming
    Replies: 1
    Last Post: 18th August 2006, 13:19
  5. QFileSystemWatcher Question (Qt 4.1.2tp)
    By momesana in forum Qt Programming
    Replies: 8
    Last Post: 25th July 2006, 14:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.