Revamp Mandelbrot example: Use a Literal operator to create QString
Create QString at compile time using the literal operator""s instead of using pointers to characters. This way, no conversion or allocation will occur at runtime. Task-number: QTBUG-108861 Pick-to: 6.6 6.5 Change-Id: I4fb51d74abbbfa08fb9fddfa90d8afcebd82a7e2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
parent
a4d7a4ccb3
commit
ae0d545d31
@ -9,16 +9,18 @@
|
||||
#include <QCommandLineOption>
|
||||
#include <QDebug>
|
||||
|
||||
using namespace Qt::StringLiterals;
|
||||
|
||||
//! [0]
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription("Qt Mandelbrot Example");
|
||||
parser.setApplicationDescription(u"Qt Mandelbrot Example"_s);
|
||||
parser.addHelpOption();
|
||||
parser.addVersionOption();
|
||||
QCommandLineOption passesOption("passes", "Number of passes (1-8)", "passes");
|
||||
QCommandLineOption passesOption(u"passes"_s, u"Number of passes (1-8)"_s, u"passes"_s);
|
||||
parser.addOption(passesOption);
|
||||
parser.process(app);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user