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

@@ -568,6 +568,7 @@ void SettingsDialog::ensureCategoryWidget(Category *category)
for (int j = 0; j < category->pages.size(); ++j) {
IOptionsPage *page = category->pages.at(j);
QWidget *widget = page->widget();
ICore::setupScreenShooter(page->displayName(), widget);
SmartScrollArea *ssa = new SmartScrollArea(this);
ssa->setWidget(widget);
widget->setAutoFillBackground(false);