nish
nish

Reputation: 1058

qstring white space

  QString fe = "C:\\Program Files\\Autodesk\\Maya2008\\bin\\imconvert.exe "; 

This line gives a problem because of space between Program and Files. How is it possible to decode it so that it is treated as one complete string

Brgds,

kNish

Upvotes: 1

Views: 1262

Answers (3)

Phil Hannent
Phil Hannent

Reputation: 12317

In windows you would do:

QString fe = "\"C:\\Program Files\\Autodesk\\Maya2008\\bin\\imconvert.exe\""; 

Upvotes: 0

Kamil Klimek
Kamil Klimek

Reputation: 13130

Use QUrl::toPercentEncoding static method

Upvotes: 0

Patrice Bernassola
Patrice Bernassola

Reputation: 14426

You can use a QFileInfo object to store it. This object accepts all path even if they have spaces. In addition you have some functions to do all checks you need before using it.

Upvotes: 3

Related Questions