I have this type of problem. On printWidget with printDialog inserting file in database. Opening (putting on QDir::tempPatch() )it I can it edit and so on. On save I am checkink modified date. But now I need to open file (for example *doc) , close my printWidget, open for example serviceOrderWidget, close it, go to my opened *doc file, editing it, and saving. When the my program need to ask me want i to save edited file.
How can i check is this program(file with *.doc) closed? Now i opening it
Qt Code:
  1. void FileWidget::on_openButton_clicked()
  2. {
  3. QString id=lineEdit->text();
  4. QString failas=lineEdit_2->text()+"."+typeEdit->text();
  5. QString tempFile=QDir::tempPath()+"/"+id+failas;
  6.  
  7. QFile f(tempFile);
  8. f.open(QIODevice::WriteOnly);
  9. f.write(record->getValue("file", "content").toByteArray());
  10. f.close();
  11.  
  12. QFileInfo info(tempFile);
  13. firstDate=info.lastModified();
  14.  
  15. QDesktopServices::openUrl(QUrl::fromLocalFile(tempFile));
  16.  
  17.  
  18. //qDebug()<<firstDate;
To copy to clipboard, switch view to plain text mode