Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Switching beween Application
Forum Updated to NodeBB v4.3 + New Features

Switching beween Application

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Praveenin_ece
    wrote on last edited by
    #1

    Hi,
    I am New to -QT- Qt, i need some clarification. This is regarding Switching between Open Applications

    I 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

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      [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.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fluca1978
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved