Add some mechanism to help screenshot creation

If QTC_SCREENSHOTS_PATH points to a writable directory, each widget that
has been registered with ICore's setupScreenShooter(const QString &name,
QWidget *w) will dump a screen shot to this directory as soon as the
widget is shown.

Change-Id: I2dec12064f1bb3c510d2fd9d27c1b79f7b7d5f30
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
hjk
2016-12-20 11:19:22 +01:00
parent f58a617ea9
commit cdaa4aee1a
3 changed files with 54 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
#include "id.h"
#include <QObject>
#include <QRect>
#include <QSettings>
#include <functional>
@@ -130,6 +131,7 @@ public:
static void addPreCloseListener(const std::function<bool()> &listener);
static QString systemInformation();
static void setupScreenShooter(const QString &name, QWidget *w, const QRect &rc = QRect());
public slots:
static void saveSettings();