March 31, 2012

Pradeep Biswal Pradeep Biswal
Lab Rat
26 posts

how to open a txt file in the foreground above/infront of all other opened dir using qt api?

 

Hi All,

I want to launch/open a txt file when i am exiting from my qt app. To do that am using the below qt api

QDesktopServices::openUrl(QUrl(QLatin1String(“file:///C:/myapp/releasenote.txt”), QUrl::TolerantMode));

But the issue is if some other folder is opened the file txt file is opened exactly behind of the opened dir or file.
How to fix this issue?
Is there any other api or setting required which will make this visible in front of other opened dirs.

Regards,
Pradeep

 Signature 

Regards,
Pradeep

6 replies

March 31, 2012

RazrFalcon RazrFalcon
Lab Rat
114 posts

Maybe startDetached [qt-project.org] could help.
But I don’t know how to get name of app which attached to .txt extension.

 Signature 

QT != Qt
Gentoo + KDE

April 2, 2012

Pradeep Biswal Pradeep Biswal
Lab Rat
26 posts

Thanks for your reply. i dont want to use QProcess. Is there any other way how to make this possible.

 Signature 

Regards,
Pradeep

April 2, 2012

Andre Andre
Area 51 Engineer
6075 posts

Operating systems nowadays often prevent applications from doing window management tasks like these. You might run into such a limitation here…

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

April 2, 2012

Pradeep Biswal Pradeep Biswal
Lab Rat
26 posts

Yes i have verified on windows xp and it works fine but on windows 7 this is an issue.

 Signature 

Regards,
Pradeep

April 2, 2012

Andre Andre
Area 51 Engineer
6075 posts

Probably little you can do about that, then. You could look into windows 7 API to see if you can do anything more, but Qt does not supply such functionality.

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

April 4, 2012

Pradeep Biswal Pradeep Biswal
Lab Rat
26 posts

Ok, Thanks for your reply. then i need to check for windows api to do so.

 Signature 

Regards,
Pradeep

 
  ‹‹ Localization in Qt      Q_PROPERTY[SOLVED] ››

You must log in to post a reply. Not a member yet? Register here!