comparison main/main.cpp @ 2360:7bed1c28b5e9

QCommandLineParser::addOptions is too recent for the compatibility deb build
author Chris Cannam
date Thu, 10 Oct 2019 10:21:52 +0100
parents 3dacb1001537
children 2cd56528616a
comparison
equal deleted inserted replaced
2359:f195f037e440 2360:7bed1c28b5e9
262 QCommandLineParser parser; 262 QCommandLineParser parser;
263 parser.setApplicationDescription(QApplication::tr("\nSonic Visualiser is a program for viewing and exploring audio data\nfor semantic music analysis and annotation.")); 263 parser.setApplicationDescription(QApplication::tr("\nSonic Visualiser is a program for viewing and exploring audio data\nfor semantic music analysis and annotation."));
264 parser.addHelpOption(); 264 parser.addHelpOption();
265 parser.addVersionOption(); 265 parser.addVersionOption();
266 266
267 parser.addOptions({ 267 QList<QCommandLineOption> commandOptions {
268 { "no-audio", QApplication::tr 268 { "no-audio", QApplication::tr
269 ("Do not attempt to open an audio output device.") }, 269 ("Do not attempt to open an audio output device.") },
270 { "no-osc", QApplication::tr 270 { "no-osc", QApplication::tr
271 ("Do not provide an Open Sound Control port for remote control.") }, 271 ("Do not provide an Open Sound Control port for remote control.") },
272 { "no-splash", QApplication::tr 272 { "no-splash", QApplication::tr
273 ("Do not show a splash screen.") }, 273 ("Do not show a splash screen.") },
274 { "osc-script", QApplication::tr 274 { "osc-script", QApplication::tr
275 ("Batch run the Open Sound Control script found in the given file. Supply \"-\" as file to read from stdin. Scripts consist of /command arg1 arg2 ... OSC control lines, optionally interleaved with numbers to specify pauses in seconds."), 275 ("Batch run the Open Sound Control script found in the given file. Supply \"-\" as file to read from stdin. Scripts consist of /command arg1 arg2 ... OSC control lines, optionally interleaved with numbers to specify pauses in seconds."),
276 "osc.txt" } 276 "osc.txt" }
277 }); 277 };
278 for (auto option: commandOptions) { // NB addOptions was added in
279 // Qt 5.4, slightly too new
280 // for us at present
281 parser.addOption(option);
282 }
278 283
279 parser.addPositionalArgument 284 parser.addPositionalArgument
280 ("[<file> ...]", QApplication::tr("One or more Sonic Visualiser (.sv) and audio files may be provided.")); 285 ("[<file> ...]", QApplication::tr("One or more Sonic Visualiser (.sv) and audio files may be provided."));
281 286
282 QStringList args = application.arguments(); 287 QStringList args = application.arguments();