QT: How to raise application from background?

Discussion in 'C++' started by Szyk, Feb 21, 2011.

  1. Szyk

    Szyk Guest

    Hi

    I am writting kind of text editor program. So the main feature is
    "running only one instance" and raising app from background when user
    invoke it with file name as parameter. Already I have done comunication
    via local socket (between already running app and new starting app), but
    I have no idea how to raise it from background when it obtain file name
    from socket. I use QWidget::raise() and QWidget::activateWindow() but it
    does not work, the only effect is blinking program icon on task bar.

    In other words I want the same behaviour (raise program from background)
    as Chrome or any text editor when it is already running as "only one
    instance" and when user invoke it with file name or URL as parameter.


    Szyk
    Szyk, Feb 21, 2011
    #1
    1. Advertising

  2. Szyk

    Rolf Magnus Guest

    Qt isn't really the topic of this news group, because it's not part of
    standard C++ so you should find another place for this type of questions in
    the future.

    Szyk wrote:

    > Already I have done comunication via local socket (between already running
    > app and new starting app), but I have no idea how to raise it from
    > background when it obtain file name from socket. I use QWidget::raise()
    > and QWidget::activateWindow() but it does not work, the only effect is
    > blinking program icon on task bar.


    What exactly do you mean by "raise it from background"? Putting it on top if
    it's behind other windows? That's what raise() should do. Or do you want it
    to get the focus? That's what activateWindow() does. Or do you mean to show
    the window if it's currently minimized? That would be QWidget::show().
    Rolf Magnus, Feb 23, 2011
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jacol

    raise or not to raise [Newbie]

    Jacol, Feb 3, 2007, in forum: Python
    Replies:
    5
    Views:
    402
    Gabriel Genellina
    Feb 5, 2007
  2. ernest
    Replies:
    2
    Views:
    286
    Roy Smith
    Nov 14, 2010
  3. Szyk
    Replies:
    7
    Views:
    707
    RaZiel
    Mar 12, 2011
  4. Jack Bates
    Replies:
    0
    Views:
    275
    Jack Bates
    May 2, 2011
  5. bvdp

    Raise X or Raise X()?

    bvdp, Mar 11, 2012, in forum: Python
    Replies:
    10
    Views:
    361
    Stefan Behnel
    Mar 12, 2012
Loading...

Share This Page