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. Workaround(s) for having spaces in the Path for Qt Assistant Document collection?

Workaround(s) for having spaces in the Path for Qt Assistant Document collection?

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 4.5k 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.
  • J Offline
    J Offline
    jh224
    wrote on 2 Aug 2013, 16:46 last edited by
    #1

    Is there a workaround to have spaces in the path for Qt Assistant document collection? I don't see where this a problem in the documentation but If I put the collection document where there are spaces in the path, it does not work.

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Buckets
      wrote on 2 Aug 2013, 17:59 last edited by
      #2

      generally when I have a path with spaces like C:\Program Files I put quotes around it "C:\Program Files".

      not sure if this will help ya

      ba ba ba
      ba na na na

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jh224
        wrote on 2 Aug 2013, 18:43 last edited by
        #3

        The following is how I implement it. I can not get it to work when my app is in C:\Program Files. Instead I have to put it in C:\myDir\myapp

        @
        void launchHelp()
        {
        QProcess *proc = new QProcess;

        QString collectionPath = QApplication::applicationDirPath()+"/man/man.qhc";

        QString app = QLatin1String("assistant -hide bookmarks -collectionFile "+collectionPath.toAscii();

        proc->start(app);

        }

        @

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MuldeR
          wrote on 2 Aug 2013, 19:38 last edited by
          #4

          If nothing else helps, you can always use "Junction":http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx to create a symbolic link - without spaces in the path! - to the problematic folder. For example, you could just link "C:\Program Files\Some Folder With Spaces" to "C:\MySymlink" and use that instead of the original folder...

          (Yes, Windows/NTFS does support symbolic links, at least for folders)

          My OpenSource software at: http://muldersoft.com/

          Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

          Go visit the coop: http://youtu.be/Jay...

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jh224
            wrote on 6 Aug 2013, 10:57 last edited by
            #5

            Buckets, it finally clicked what you were saying. The following is the solution that I used with the escape Quote character ("):

            @
            void launchHelp()
            {
            QProcess *proc = new QProcess;

            QString collectionPath = "\""+QApplication::applicationDirPath()+"/man/man.qhc\"";
             
            QString app = QLatin1String("assistant -hide bookmarks -collectionFile "+collectionPath.toAscii();
             
            proc->start(app);
             
            }
            

            @

            1 Reply Last reply
            0
            • B Offline
              B Offline
              Buckets
              wrote on 6 Aug 2013, 16:05 last edited by
              #6

              I'm glad it helped :)

              ba ba ba
              ba na na na

              1 Reply Last reply
              0
              • M Offline
                M Offline
                MuldeR
                wrote on 6 Aug 2013, 19:16 last edited by
                #7

                Qt automatically wraps arguments with white-spaces into quotes!

                But you need to pass them properly, each argument as a separate token:
                @QString appDir = QApplication::applicationDirPath();
                QString collectionPath = QString("%1/man/man.qhc").arg(appDir);

                QStringList args;
                args << "-hide" << "bookmarks";
                args << "-collectionFile" << collectionPath;

                QProcess *proc = new QProcess;
                proc->start("assistant", args);@

                My OpenSource software at: http://muldersoft.com/

                Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

                Go visit the coop: http://youtu.be/Jay...

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jh224
                  wrote on 7 Aug 2013, 11:09 last edited by
                  #8

                  Thanks Mulder. That works and is more elegant.

                  1 Reply Last reply
                  0

                  5/8

                  6 Aug 2013, 10:57

                  • Login

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