Merge pull request #12715 from ctrlaltdavid/21677

Add Window.raise() as replacement for Window.raiseMainWindow()
This commit is contained in:
Ken Cooke 2018-03-30 09:41:54 -07:00 committed by GitHub
commit a2be291363
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -78,13 +78,17 @@ void WindowScriptingInterface::setFocus() {
});
}
void WindowScriptingInterface::raiseMainWindow() {
void WindowScriptingInterface::raise() {
// It's forbidden to call raise() from another thread.
qApp->postLambdaEvent([] {
qApp->raise();
});
}
void WindowScriptingInterface::raiseMainWindow() {
raise();
}
/// Display an alert box
/// \param const QString& message message to display
/// \return QScriptValue::UndefinedValue

View file

@ -68,9 +68,16 @@ public slots:
*/
void setFocus();
/**jsdoc
* Raise the Interface window if it is minimized. If raised, the window gains focus.
* @function Window.raise
*/
void raise();
/**jsdoc
* Raise the Interface window if it is minimized. If raised, the window gains focus.
* @function Window.raiseMainWindow
* @deprecated Use {@link Window.raise|raise} instead.
*/
void raiseMainWindow();