м
Size: a a a
AA
МК
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QCommandLineOption kOption({"k", "coef"}, "Set coefficient");
QCommandLineOption pOption({"d", "dir", "f", "file", "p", "path"}, "Input path");
QCommandLineParser parser;
parser.addOptions({kOption, pOption});
parser.process(a.arguments());
qDebug() << a.arguments();
// ("D:\\UserFiles\\Documents\\QtProjects\\BIN\\test\\Desktop_Qt_5_15_2_MinGW_64_bit\\release\\cbz2pdf.exe", "-k", "0.75")
qDebug() << parser.isSet(kOption) << parser.value("k"); // value(kOption) - пробовал тоже
// true ""
qDebug() << parser.isSet(pOption) << parser.value(pOption);
// false ""
}
МК
МК
МК
МК
YD
YD
YD
YD
YD
AS
For find_package to be successful, CMake must find the Qt installation in one of the following ways:
Set your CMAKE_PREFIX_PATH environment variable to the Qt 5 installation prefix. This is the recommended way.
Set the Qt5_DIR in the CMake cache to the location of the Qt5Config.cmake file.
YD
AS
YD