2014-04-29 71 views
0

我想分析通過命令行使用C++和QT傳遞的選項,而不使用外部庫。具體而言,假設命令行可能有以下的,什麼是分析和提取所需的信息,最簡單的方法(路徑INT_1INT_2int_3)?如何從命令行提取信息?

--intrinsic <path> <int_1> <int_2> <int_3> 
--extrincic <path> -solve -3D <string> -2D <string> 
--extrincic <path> -verify -3D <string> 
+3

您可以使用'QCoreApplication :: arguments()'並遍歷檢查其內容的項目。 – vahancho

+4

也許新的類QCommandLineParser可以幫助你:http://qt-project.org/doc/qt-5/qcommandlineparser.html – avb

+0

@avb你的評論是答案,爲什麼不把它作爲答案,並添加更多的細節。 –

回答