summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagergui.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-06-02 15:33:01 +0300
committerKatja Marttila <katja.marttila@qt.io>2020-06-04 10:58:11 +0000
commit3235629a868ace7a1f1f4d79ef7474ca30b2123e (patch)
tree83ebd1bec72f58afba1669fdb96e3ab7685fc9fc /src/libs/installer/packagemanagergui.cpp
parent25e70dd8e061425be89481caf515591390425cd5 (diff)
Add function to enable button click with objectname
Task-number: QTIFW-1707 Change-Id: I8574ef96df6a00e577549342d4a4336207dcd9ec Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagergui.cpp')
-rw-r--r--src/libs/installer/packagemanagergui.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libs/installer/packagemanagergui.cpp b/src/libs/installer/packagemanagergui.cpp
index d80709416..751076f9a 100644
--- a/src/libs/installer/packagemanagergui.cpp
+++ b/src/libs/installer/packagemanagergui.cpp
@@ -530,6 +530,20 @@ void PackageManagerGui::clickButton(int wb, int delay)
}
/*!
+ Clicks the button specified by \a objectName after the delay specified by \a delay.
+
+ \sa {gui::clickButton}{gui.clickButton}
+*/
+void PackageManagerGui::clickButton(const QString &objectName, int delay) const
+{
+ QPushButton *button = findChild<QPushButton *>(objectName);
+ if (button)
+ QTimer::singleShot(delay, button, &QAbstractButton::click);
+ else
+ qCWarning(QInstaller::lcInstallerInstallLog) << "Button with objectname: " << objectName << "not found!";
+}
+
+/*!
Returns \c true if the button specified by \a wb is enabled. Returns \c false
if a button of the specified type is not found.