QT: How to raise application from background?

S

Szyk

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
 
R

Rolf Magnus

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.
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().
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top