Revamp Local Fortune Client Example: Create QString instead of char *
Create QString at compile time using the literal operator""s instead of using pointer to characters. This way, no conversion or allocation will occur at runtime. Task-number: QTBUG-117036 Pick-to: 6.6 6.5 Change-Id: I9942ef8efa38de9ac5975799249a65fcb4c966c9 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
parent
b83736be05
commit
badb0818f5
@ -9,9 +9,11 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
using namespace Qt::StringLiterals;
|
||||||
|
|
||||||
Client::Client(QWidget *parent)
|
Client::Client(QWidget *parent)
|
||||||
: QDialog(parent),
|
: QDialog(parent),
|
||||||
hostLineEdit(new QLineEdit("fortune")),
|
hostLineEdit(new QLineEdit(u"fortune"_s)),
|
||||||
getFortuneButton(new QPushButton(tr("Get Fortune"))),
|
getFortuneButton(new QPushButton(tr("Get Fortune"))),
|
||||||
statusLabel(new QLabel(tr("This examples requires that you run the "
|
statusLabel(new QLabel(tr("This examples requires that you run the "
|
||||||
"Local Fortune Server example as well."))),
|
"Local Fortune Server example as well."))),
|
||||||
|
Loading…
Reference in New Issue
Block a user