Results 1 to 2 of 2

Thread: How to use QProcess::execute() if the parameter has non-ascii?

  1. #1
    Join Date
    Jun 2009
    Posts
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to use QProcess::execute() if the parameter has non-ascii?

    In my program, I use QProcess::execute() to execute some cmds.
    Such as
    Qt Code:
    1. QString x = "copy a.txt b.txt"
    2. QProcess::execute(x);
    To copy to clipboard, switch view to plain text mode 
    It works OK.

    But if the "x" has non-ascii.Such as
    Qt Code:
    1. QString x = "copy c:\中文\a.txt c:\中文\b.txt";
    2. QProcess::execute(x).
    To copy to clipboard, switch view to plain text mode 
    It doesn't has any effect.
    Could you give me some helps? Thans a lot!!!

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use QProcess::execute() if the parameter has non-ascii?

    Did you escape the backslashes?

    Qt Code:
    1. QString x = "copy c:\\中文\\a.txt c:\\中文\\b.txt";
    2. QProcess::execute(x).
    To copy to clipboard, switch view to plain text mode 
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. How to declare SLOT as a parameter to member function?
    By QPlace in forum Qt Programming
    Replies: 2
    Last Post: 17th July 2018, 00:41
  2. application parameter problem..
    By triperzonak in forum Newbie
    Replies: 7
    Last Post: 9th February 2009, 01:56
  3. How to Compare Characters ASCII value?
    By merry in forum Qt Programming
    Replies: 5
    Last Post: 14th July 2008, 12:05
  4. Error: BadMatch --> what's it?
    By mattia in forum Newbie
    Replies: 4
    Last Post: 9th June 2008, 12:20
  5. const function parameter problems
    By stevey in forum General Programming
    Replies: 3
    Last Post: 18th December 2006, 22:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.