Bonjour,
je souhaiterais savoir si il est possible de forcer le focus sur un process créer via QProcess.
Merci
Bonjour,
je souhaiterais savoir si il est possible de forcer le focus sur un process créer via QProcess.
Merci
Qu'appelles tu par "forcer le focus" ? Si tu veux parler de faire apparaître la fenêtre au premier plan, et/ou lui donner l'accès aux events clavier etc, je ne pense pas que ça soit faisable avec Qt.
Une fois le processus lancé, sa gestion dépend de l'OS (même si on peut faire quelques trucs avec Qt).
Mais je me trompe peut être.
Etienne
Mon application fille qui est une QDialog lis la date de modification d'un fichier et si certain critère sont remplis, appel la méthode show().
la fenêtre se montre bien mais n'a pas le focus
Et est-ce que le nouveau process peut lui même se mettre en premier plan via une commande ?
Si ton process est une application à toi (faite avec Qt), ça devient plus jouable.
Regarde aussi du côté de raise().void QWidget::activateWindow ()
Sets the top-level widget containing this widget to be the active window.
An active window is a visible top-level window that has the keyboard input focus.
This function performs the same operation as clicking the mouse on the title bar of a top-level window. On X11, the result depends on the Window Manager. If you want to ensure that the window is stacked on top as well you should also call raise(). Note that the window must be visible, otherwise activateWindow() has no effect.
On Windows, if you are calling this when the application is not currently the active one then it will not make it the active window. It will change the color of the taskbar entry to indicate that the window has changed in some way. This is because Microsoft does not allow an application to interrupt what the user is currently doing in another application.
See also isActiveWindow(), window(), and show().
G.
Partager