diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2014-12-08 17:34:12 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2014-12-10 09:44:27 +0100 |
commit | 71c248e2704225dc4e361699d08fe3b422a4da4f (patch) | |
tree | a9f12e4f3b7f3ec2315f833cfa6e4ac13b7b4285 /src/libs/installer/packagemanagergui.cpp | |
parent | cb57245ea95d2c1209bcc14f6d119d5ed912a0bf (diff) |
Expose findChild, findChildren methods to JS
Re-add the findChild, findChildren methods known from Qt Script.
Change-Id: I3db6be53ccd89a09b2c7de14ba7f96ebb26dbdbb
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/packagemanagergui.cpp')
-rw-r--r-- | src/libs/installer/packagemanagergui.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp index 4653c7ff6..5b9e7493a 100644 --- a/src/libs/installer/packagemanagergui.cpp +++ b/src/libs/installer/packagemanagergui.cpp @@ -698,6 +698,26 @@ void PackageManagerGui::setSettingsButtonEnabled(bool enabled) btn->setEnabled(enabled); } +/** + Returns the first descendant of \a parent that has \a objectName as name. + + This method is meant to be invoked from script. + */ +QObject *PackageManagerGui::findChild(QObject *parent, const QString &objectName) +{ + return parent->findChild<QObject*>(objectName); +} + +/** + Returns all descendants of \a parent that have \a objectName as name. + + This method is meant to be invoked from script. + */ +QList<QObject *> PackageManagerGui::findChildren(QObject *parent, const QString &objectName) +{ + return parent->findChildren<QObject*>(objectName); +} + void PackageManagerGui::customButtonClicked(int which) { if (QWizard::WizardButton(which) == QWizard::CustomButton1 && d->m_showSettingsButton) |