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. How to open a txt file in the foreground above/infront of all other opened dir using qt api?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 2.7k Views
  • 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
    prbiswal
    wrote on last edited by
    #1

    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

    Regards,
    Pradeep

    1 Reply Last reply
    0
    • R Offline
      R Offline
      RazrFalcon
      wrote on last edited by
      #2

      Maybe "startDetached":http://qt-project.org/doc/qt-4.8/qprocess.html#startDetached could help.
      But I don't know how to get name of app which attached to .txt extension.

      1 Reply Last reply
      0
      • P Offline
        P Offline
        prbiswal
        wrote on last edited by
        #3

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

        Regards,
        Pradeep

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • P Offline
            P Offline
            prbiswal
            wrote on last edited by
            #5

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

            Regards,
            Pradeep

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • P Offline
                P Offline
                prbiswal
                wrote on last edited by
                #7

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

                Regards,
                Pradeep

                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