Switching beween Application
-
Hi,
I am New to -QT- Qt, i need some clarification. This is regarding Switching between Open ApplicationsI have created a Widget with 3 Buttons. Each Button opened 1 Applications using QProcess (
Say for Example
Button1 opens Xterm,
Button2 opens Firefox
Button3 Opens Calculator
i have clicked on all 3 Buttons and all three applications are running.i want to implement a feature like this, If i click on Button1 Again i want to make sure that Xterm that was already opened Get the Focus. i.e The I do not want to open a new Xterm But to bring the Xterm window that was previously opened on the top of all the open windows. How do i implement this?
I tried to implement using QX11EmbedContainer but it it not effective for all applications.
Thanks in advance
-
[quote author="Praveenin_ece" date="1317894441"]Hi,
i want to implement a feature like this, If i click on Button1 Again i want to make sure that Xterm that was already opened Get the Focus. i.e The I do not want to open a new Xterm But to bring the Xterm window that was previously opened on the top of all the open windows. How do i implement this?
[/quote]This is not possible out of the box with Qt.
You have to use OS stuff to move the input focus from your process to the corresponding process. -
Seems to me a problem related to the specific platform you are running on. I think the problem is that QProcess does not know if your process runs within an x server or a command line or in background. Therefore I guess it has not effective way to place the window on top, and I think this could also be complicated by having applications running on multiple desktops. Not sure if "desktop widget":http://doc.qt.nokia.com/4.7/qapplication.html#desktop can help in this case.