Home > Mobile >  QT escape character "" how to do ah
QT escape character "" how to do ah

Time:03-09

====correct usage:
M_db=QSqlDatabase: : addDatabase (" QSQLITE ", "QSQLITE");
M_db. SetDatabaseName (" D: \ CameraDB. Sqlite ");
BRet=m_db. The open ();

====error usage:
M_db=QSqlDatabase: : addDatabase (" QSQLITE ", "QSQLITE");
M_db. SetDatabaseName (" D: \ \ CameraDB sqlite ");
BRet=m_db. The open ();

=====read strPath right
[the System]
Path=d: \ \ Test \ \ MyDir

QSettings CFG (" D: \ \ config ini ", QSettings: : IniFormat);
QString strPath=CFG. Value (System/" Path ", ""). The toString ();

=====read strPath error
[the System]
Path=d: \ Test \ MyDir

QSettings CFG (" D: \ \ config ini ", QSettings: : IniFormat);
QString strPath=CFG. Value (System/" Path ", ""). The toString ();

Who can summarize,

CodePudding user response:

QT framework upset ah, why configuration file with two slashes ah

CodePudding user response:

Always use "/" no matter what the platform.
  •  Tags:  
  • Qt
  • Related