Optionally monitor changes to files loaded with ReportEngine::loadFromFile()

When using the designer as a stand alone application and the renderer/preview in the
user application, the preview window would have to be closed and opened again every
time a change was made to the report.

This change adds an optional QFileSystemWatcher to monitor changes to the report file
and automatically refreshes the preview in the application when it is saved.

It may be turned on using the new parameter to ReportEngine::loadFromFile().

If the preview window is open in the application and the file name changes or the file is
removed, inform the user and close the preview window.
This commit is contained in:
Andy Maloney
2017-04-19 22:43:48 -04:00
parent e786a9a6e6
commit 94db98d596
7 changed files with 89 additions and 37 deletions

View File

@@ -82,7 +82,7 @@ public:
void setShowProgressDialog(bool value);
IDataSourceManager* dataManager();
IScriptEngineManager* scriptManager();
bool loadFromFile(const QString& fileName);
bool loadFromFile(const QString& fileName, bool autoLoadPreviewOnChange = false);
bool loadFromByteArray(QByteArray *data);
bool loadFromString(const QString& data);
QString reportFileName();