QtBase  v6.3.1
main.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of the documentation of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:BSD$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://www.qt.io/contact-us.
16 **
17 ** BSD License Usage
18 ** Alternatively, you may use this file under the terms of the BSD license
19 ** as follows:
20 **
21 ** "Redistribution and use in source and binary forms, with or without
22 ** modification, are permitted provided that the following conditions are
23 ** met:
24 ** * Redistributions of source code must retain the above copyright
25 ** notice, this list of conditions and the following disclaimer.
26 ** * Redistributions in binary form must reproduce the above copyright
27 ** notice, this list of conditions and the following disclaimer in
28 ** the documentation and/or other materials provided with the
29 ** distribution.
30 ** * Neither the name of The Qt Company Ltd nor the names of its
31 ** contributors may be used to endorse or promote products derived
32 ** from this software without specific prior written permission.
33 **
34 **
35 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
38 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
39 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
42 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
43 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
45 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
46 **
47 ** $QT_END_LICENSE$
48 **
49 ****************************************************************************/
50 
51 #include <QtGui>
52 #include <QApplication>
53 #include <stdio.h>
54 
55 class Widget : public QWidget
56 {
57 public:
58  Widget(QWidget *parent = nullptr);
59 
60  void constCharPointer();
61  void constCharArray();
62  void characterReference();
63  void atFunction();
64  void stringLiteral();
65  void modify();
66  void index();
67  QString boolToString(bool b);
68  void nullVsEmpty();
69 
70  void appendFunction();
71  void argFunction();
72  void chopFunction();
73  void compareFunction();
75  void containsFunction();
76  void countFunction();
77  void dataFunction();
78  void endsWithFunction();
79  void fillFunction();
80  void fromRawDataFunction();
81 
82  void indexOfFunction();
83  void firstIndexOfFunction();
84  void insertFunction();
85  void isNullFunction();
86  void isEmptyFunction();
87  void lastIndexOfFunction();
88  void firstFunction();
89  void leftJustifiedFunction();
90  void slicedFunction();
91  void numberFunction();
92 
93  void prependFunction();
94  void removeFunction();
95  void replaceFunction();
96  void reserveFunction();
97  void resizeFunction();
98  void lastFunction();
100  void sectionFunction();
101  void setNumFunction();
102  void simplifiedFunction();
103 
104  void sizeFunction();
105  void splitFunction();
107  void sprintfFunction();
108  void startsWithFunction();
109  void toDoubleFunction();
110  void toFloatFunction();
111  void toIntFunction();
112  void toLongFunction();
113  void toLongLongFunction();
114 
115  void toLowerFunction();
116  void toShortFunction();
117  void toUIntFunction();
118  void toULongFunction();
119  void toULongLongFunction();
120  void toUShortFunction();
121  void toUpperFunction();
122  void trimmedFunction();
123  void truncateFunction();
124 
125  void plusEqualOperator();
126  void arrayOperator();
127 };
128 
130  : QWidget(parent)
131 {
132 }
133 
135 {
137  QString str = "Hello";
139 }
140 
142 {
144  static const QChar data[4] = { 0x0055, 0x006e, 0x10e3, 0x03a3 };
145  QString str(data, 4);
147 }
148 
150 {
152  QString str;
153  str.resize(4);
154 
155  str[0] = QChar('U');
156  str[1] = QChar('n');
157  str[2] = QChar(0x10e3);
158  str[3] = QChar(0x03a3);
160 }
161 
163 {
165  QString str;
166 
167  for (qsizetype i = 0; i < str.size(); ++i) {
168  if (str.at(i) >= QChar('a') && str.at(i) <= QChar('f'))
169  qDebug() << "Found character in range [a-f]";
170  }
172 }
173 
175 {
177  QString str;
178 
179  if (str == "auto" || str == "extern"
180  || str == "static" || str == "register") {
181  // ...
182  }
184 }
185 
187 {
189  QString str = "and";
190  str.prepend("rock "); // str == "rock and"
191  str.append(" roll"); // str == "rock and roll"
192  str.replace(5, 3, "&"); // str == "rock & roll"
194 }
195 
197 {
199  QString str = "We must be <b>bold</b>, very <b>bold</b>";
200  qsizetype j = 0;
201 
202  while ((j = str.indexOf("<b>", j)) != -1) {
203  qDebug() << "Found <b> tag at index position" << j;
204  ++j;
205  }
207 }
208 
211 {
212  QString result;
213  if (b)
214  result = "True";
215  else
216  result = "False";
217  return result;
218 }
220 
221 
223 {
225  QString().isNull(); // returns true
226  QString().isEmpty(); // returns true
227 
228  QString("").isNull(); // returns false
229  QString("").isEmpty(); // returns true
230 
231  QString("abc").isNull(); // returns false
232  QString("abc").isEmpty(); // returns false
234 }
235 
237 {
239  QString x = "free";
240  QString y = "dom";
241 
242  x.append(y);
243  // x == "freedom"
245 
247  x.insert(x.size(), y);
249 }
250 
252 {
254  QString i; // current file's number
255  QString total; // number of files to process
256  QString fileName; // current file's name
257 
258  QString status = QString("Processing file %1 of %2: %3")
259  .arg(i).arg(total).arg(fileName);
261 
262  {
264  int i; // current file's number
265  int total; // number of files to process
266  QStringView fileName; // current file's name
267 
268  QString status = QString("Processing file %1 of %2: %3")
269  .arg(i).arg(total).arg(fileName);
271  }
272 
274  QString str;
276  str = "%1 %2";
277 
278  str.arg("%1f", "Hello"); // returns "%1f Hello"
279  str.arg("%1f").arg("Hello"); // returns "Hellof %2"
281 
283  str = "%1%3%2";
284  str.arg("Hello").arg(20).arg(50); // returns "Hello500"
285 
286  str = "%1%2%3";
287  str.arg("Hello").arg(50).arg(20); // returns "Hello5020"
289 
291  str = "%1%3%2";
292  str.arg("Hello", QString::number(20), QString::number(50)); // returns "Hello5020"
294 
296  str = QString("Decimal 63 is %1 in hexadecimal")
297  .arg(63, 0, 16);
298  // str == "Decimal 63 is 3f in hexadecimal"
299 
301  str = QString("%1 %L2 %L3")
302  .arg(12345)
303  .arg(12345)
304  .arg(12345, 0, 16);
305  // str == "12345 12,345 3039"
307 }
308 
310 {
312  QString str("LOGOUT\r\n");
313  str.chop(2);
314  // str == "LOGOUT"
316 }
317 
319 {
320  int x = QString::compare("auto", "auto"); // x == 0
321  int y = QString::compare("auto", "car"); // y < 0
322  int z = QString::compare("car", "auto"); // z > 0
323 }
324 
326 {
328  int x = QString::compare("aUtO", "AuTo", Qt::CaseInsensitive); // x == 0
329  int y = QString::compare("auto", "Car", Qt::CaseSensitive); // y > 0
330  int z = QString::compare("auto", "Car", Qt::CaseInsensitive); // z < 0
332 
334  int x = QtPrivate::compareStrings(u"aUtO", u"AuTo", Qt::CaseInsensitive); // x == 0
335  int y = QtPrivate::compareStrings(u"auto", u"Car", Qt::CaseSensitive); // y > 0
336  int z = QtPrivate::compareStrings(u"auto", u"Car", Qt::CaseInsensitive); // z < 0
338 }
339 
341 {
343  QString str = "Peter Pan";
344  str.contains("peter", Qt::CaseInsensitive); // returns true
346 }
347 
349 {
351  QString str = "banana and panama";
352  str.count(QRegularExpression("a[nm]a")); // returns 4
354 }
355 
357 {
359  QString str = "Hello world";
360  QChar *data = str.data();
361  while (!data->isNull()) {
362  qDebug() << data->unicode();
363  ++data;
364  }
366 }
367 
369 {
371  QString str = "Bananas";
372  str.endsWith("anas"); // returns true
373  str.endsWith("pple"); // returns false
375 }
376 
378 {
380  QString str = "Berlin";
381  str.fill('z');
382  // str == "zzzzzz"
383 
384  str.fill('A', 2);
385  // str == "AA"
387 }
388 
390 {
392  QRegularExpression pattern("\u00A4");
393  static const QChar unicode[] = {
394  0x005A, 0x007F, 0x00A4, 0x0060,
395  0x1009, 0x0020, 0x0020};
396  qsizetype size = sizeof(unicode) / sizeof(QChar);
397 
398  QString str = QString::fromRawData(unicode, size);
399  if (str.contains(pattern) {
400  // ...
402  }
404 }
405 
407 {
409  QString x = "sticky question";
410  QString y = "sti";
411  x.indexOf(y); // returns 0
412  x.indexOf(y, 1); // returns 10
413  x.indexOf(y, 10); // returns 10
414  x.indexOf(y, 11); // returns -1
416 }
417 
419 {
421  QString str = "the minimum";
422  str.indexOf(QRegularExpression("m[aeiou]"), 0); // returns 4
423 
424  QString str = "the minimum";
426  str.indexOf(QRegularExpression("m[aeiou]"), 0, &match); // returns 4
427  // match.captured() == mi
429 }
430 
432 {
434  QString str = "Meal";
435  str.insert(1, QString("ontr"));
436  // str == "Montreal"
438 }
439 
441 {
443  QString().isEmpty(); // returns true
444  QString("").isEmpty(); // returns true
445  QString("x").isEmpty(); // returns false
446  QString("abc").isEmpty(); // returns false
448 }
449 
451 {
453  QString().isNull(); // returns true
454  QString("").isNull(); // returns false
455  QString("abc").isNull(); // returns false
457 }
458 
460 {
462  QString x = "crazy azimuths";
463  QString y = "az";
464  x.lastIndexOf(y); // returns 6
465  x.lastIndexOf(y, 6); // returns 6
466  x.lastIndexOf(y, 5); // returns 2
467  x.lastIndexOf(y, 1); // returns -1
469 
471  QString str = "the minimum";
472  str.lastIndexOf(QRegularExpression("m[aeiou]")); // returns 8
473 
474  QString str = "the minimum";
476  str.lastIndexOf(QRegularExpression("m[aeiou]"), -1, &match); // returns 8
477  // match.captured() == mu
479 }
480 
482 {
484  QString x = "Pineapple";
485  QString y = x.first(4); // y == "Pine"
487 }
488 
490 {
492  QString s = "apple";
493  QString t = s.leftJustified(8, '.'); // t == "apple..."
495 
497  QString str = "Pineapple";
498  str = str.leftJustified(5, '.', true); // str == "Pinea"
500 }
501 
503 {
505  QString x = "Nine pineapples";
506  QString y = x.sliced(5, 4); // y == "pine"
507  QString z = x.sliced(5); // z == "pineapples"
509 }
510 
512 {
514  long a = 63;
515  QString s = QString::number(a, 16); // s == "3f"
516  QString t = QString::number(a, 16).toUpper(); // t == "3F"
518 }
519 
521 {
523  QString x = "ship";
524  QString y = "air";
525  x.prepend(y);
526  // x == "airship"
528 }
529 
531 {
533  QString s = "Montreal";
534  s.remove(1, 4);
535  // s == "Meal"
537 
539  QString t = "Ali Baba";
541  // t == "li Bb"
543 
545  QString r = "Telephone";
546  r.remove(QRegularExpression("[aeiou]."));
547  // r == "The"
549 }
550 
552 {
554  QString x = "Say yes!";
555  QString y = "no";
556  x.replace(4, 3, y);
557  // x == "Say no!"
559 
561  QString str = "colour behaviour flavour neighbour";
562  str.replace(QString("ou"), QString("o"));
563  // str == "color behavior flavor neighbor"
565 
567  QString equis = "xxxxxx";
568  equis.replace("xx", "x");
569  // equis == "xxx"
571 
573  QString s = "Banana";
574  s.replace(QRegularExpression("a[mn]"), "ox");
575  // s == "Boxoxa"
577 
579  QString t = "A <i>bon mot</i>.";
580  t.replace(QRegularExpression("<i>([^<]*)</i>"), "\\emph{\\1}");
581  // t == "A \\emph{bon mot}."
583 }
584 
586 {
588  QString result;
589  qsizetype maxSize;
590  bool condition;
591  QChar nextChar;
592 
593  result.reserve(maxSize);
594 
595  while (condition)
596  result.append(nextChar);
597 
598  result.squeeze();
600 }
601 
603 {
605  QString s = "Hello world";
606  s.resize(5);
607  // s == "Hello"
608 
609  s.resize(8);
610  // s == "Hello???" (where ? stands for any character)
612 
614  QString t = "Hello";
615  r.resize(t.size() + 10, 'X');
616  // t == "HelloXXXXXXXXXX"
618 
620  QString r = "Hello";
621  r = r.leftJustified(10, ' ');
622  // r == "Hello "
624 }
625 
627 {
629  QString x = "Pineapple";
630  QString y = x.last(5); // y == "apple"
632 }
633 
635 {
637  QString s = "apple";
638  QString t = s.rightJustified(8, '.'); // t == "...apple"
640 
642  QString str = "Pineapple";
643  str = str.rightJustified(5, '.', true); // str == "Pinea"
645 }
646 
648 {
650  QString str;
652  QString csv = "forename,middlename,surname,phone";
653  QString path = "/usr/local/bin/myapp"; // First field is empty
655 
656 
657  str = csv.section(',', 2, 2); // str == "surname"
658  str = path.section('/', 3, 4); // str == "bin/myapp"
659  str = path.section('/', 3, 3, flag); // str == "myapp"
661 
663  str = csv.section(',', -3, -2); // str == "middlename,surname"
664  str = path.section('/', -1); // str == "myapp"
666 
668  QString data = "forename**middlename**surname**phone";
669 
670  str = data.section("**", 2, 2); // str == "surname"
671  str = data.section("**", -3, -2); // str == "middlename**surname"
673 
675  QString line = "forename\tmiddlename surname \t \t phone";
676  QRegularExpression sep("\\s+");
677  str = line.section(sep, 2, 2); // str == "surname"
678  str = line.section(sep, -3, -2); // str == "middlename surname"
680 }
681 
683 {
685  QString str;
686  str.setNum(1234); // str == "1234"
688 }
689 
691 {
693  QString str = " lots\t of\nwhitespace\r\n ";
694  str = str.simplified();
695  // str == "lots of whitespace";
697 }
698 
700 {
702  QString str = "World";
703  qsizetype n = str.size(); // n == 5
704  str.data()[0]; // returns 'W'
705  str.data()[4]; // returns 'd'
707 }
708 
710 {
712  QString str;
714 
715  str = "Some text\n\twith strange whitespace.";
716  list = str.split(QRegularExpression("\\s+"));
717  // list: [ "Some", "text", "with", "strange", "whitespace." ]
719 
721  str = "This time, a normal English sentence.";
723  // list: [ "This", "time", "a", "normal", "English", "sentence" ]
725 
727  str = "Now: this sentence fragment.";
728  list = str.split(QRegularExpression("\\b"));
729  // list: [ "", "Now", ": ", "this", " ", "sentence", " ", "fragment", "." ]
731 }
732 
734 {
736  QString str = QStringLiteral("a,,b,c");
737 
738  QStringList list1 = str.split(QLatin1Char(','));
739  // list1: [ "a", "", "b", "c" ]
740 
742  // list2: [ "a", "b", "c" ]
744 
746  QString str = "abc";
747  auto parts = str.split(QString());
748  // parts: {"", "a", "b", "c", ""}
750 
752  QString str = "/a/b/c/";
753  auto parts = str.split(QLatin1Char('/'));
754  // parts: {"", "a", "b", "c", ""}
756 }
757 
759 {
761  QString result;
762  QTextStream(&result) << "pi = " << 3.14;
763  // result == "pi = 3.14"
765 }
766 
768 {
770  QString str = "Bananas";
771  str.startsWith("Ban"); // returns true
772  str.startsWith("Car"); // returns false
774 }
775 
777 {
779  QString str = "1234.56";
780  double val = str.toDouble(); // val == 1234.56
782 
784  bool ok;
785  double d;
786 
787  d = QString( "1234.56e-02" ).toDouble(&ok); // ok == true, d == 12.3456
788 
789  d = QString( "1234.56e-02 Volt" ).toDouble(&ok); // ok == false, d == 0
791 
793  d = QString( "1234,56" ).toDouble(&ok); // ok == false
794  d = QString( "1234.56" ).toDouble(&ok); // ok == true, d == 1234.56
796 
798  d = QString( "1,234,567.89" ).toDouble(&ok); // ok == false
799  d = QString( "1234567.89" ).toDouble(&ok); // ok == true
801 }
802 
804 {
806  QString str1 = "1234.56";
807  str1.toFloat(); // returns 1234.56
808 
809  bool ok;
810  QString str2 = "R2D2";
811  str2.toFloat(&ok); // returns 0.0, sets ok to false
812 
813  QString str3 = "1234.56 Volt";
814  str3.toFloat(&ok); // returns 0.0, sets ok to false
816 }
817 
819 {
821  QString str = "FF";
822  bool ok;
823  int hex = str.toInt(&ok, 16); // hex == 255, ok == true
824  int dec = str.toInt(&ok, 10); // dec == 0, ok == false
826 }
827 
829 {
831  QString str = "FF";
832  bool ok;
833 
834  long hex = str.toLong(&ok, 16); // hex == 255, ok == true
835  long dec = str.toLong(&ok, 10); // dec == 0, ok == false
837 }
838 
840 {
842  QString str = "FF";
843  bool ok;
844 
845  qint64 hex = str.toLongLong(&ok, 16); // hex == 255, ok == true
846  qint64 dec = str.toLongLong(&ok, 10); // dec == 0, ok == false
848 }
849 
851 {
853  QString str = "The Qt PROJECT";
854  str = str.toLower(); // str == "the qt project"
856 }
857 
859 {
861  QString str = "FF";
862  bool ok;
863 
864  short hex = str.toShort(&ok, 16); // hex == 255, ok == true
865  short dec = str.toShort(&ok, 10); // dec == 0, ok == false
867 }
868 
870 {
872  QString str = "FF";
873  bool ok;
874 
875  uint hex = str.toUInt(&ok, 16); // hex == 255, ok == true
876  uint dec = str.toUInt(&ok, 10); // dec == 0, ok == false
878 }
879 
881 {
883  QString str = "FF";
884  bool ok;
885 
886  ulong hex = str.toULong(&ok, 16); // hex == 255, ok == true
887  ulong dec = str.toULong(&ok, 10); // dec == 0, ok == false
889 }
890 
892 {
894  QString str = "FF";
895  bool ok;
896 
897  quint64 hex = str.toULongLong(&ok, 16); // hex == 255, ok == true
898  quint64 dec = str.toULongLong(&ok, 10); // dec == 0, ok == false
900 }
901 
903 {
905  QString str = "FF";
906  bool ok;
907 
908  ushort hex = str.toUShort(&ok, 16); // hex == 255, ok == true
909  ushort dec = str.toUShort(&ok, 10); // dec == 0, ok == false
911 }
912 
914 {
916  QString str = "TeXt";
917  str = str.toUpper(); // str == "TEXT"
919 }
920 
922 {
924  QString str = " lots\t of\nwhitespace\r\n ";
925  str = str.trimmed();
926  // str == "lots\t of\nwhitespace"
928 }
929 
931 {
933  QString str = "Vladivostok";
934  str.truncate(4);
935  // str == "Vlad"
937 }
938 
940 {
942  QString x = "free";
943  QString y = "dom";
944  x += y;
945  // x == "freedom"
947 }
948 
950 {
952  QString str;
953 
954  if (str[0] == QChar('?'))
955  str[0] = QChar('_');
957 }
958 
959 
960 int main(int argc, char *argv[])
961 {
962  QApplication app(argc, argv);
963  Widget widget;
964  widget.show();
965  return app.exec();
966 }
small capitals from c petite p scientific f u
Definition: afcover.h:88
small capitals from c petite p scientific i
[1]
Definition: afcover.h:80
The QApplication class manages the GUI application's control flow and main settings.
Definition: qapplication.h:68
static int exec()
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:84
QVariant data(int key) const
QGraphicsObject * parent
the parent of the item
static void setDefault(const QLocale &locale)
Definition: qlocale.cpp:1271
@ UnitedStates
Definition: qlocale.h:835
@ English
Definition: qlocale.h:153
The QRegularExpression class provides pattern matching using regular expressions.
The QRegularExpressionMatch class provides the results of a matching a QRegularExpression against a s...
The QString class provides a Unicode character string.
Definition: qstring.h:388
QString & prepend(QChar c)
Definition: qstring.h:656
double toDouble(bool *ok=nullptr) const
Definition: qstring.cpp:7374
QString leftJustified(qsizetype width, QChar fill=QLatin1Char(' '), bool trunc=false) const
Definition: qstring.cpp:6518
QString last(qsizetype n) const
Definition: qstring.h:578
qsizetype count() const
Definition: qstring.h:414
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
Definition: qstring.h:514
int toInt(bool *ok=nullptr, int base=10) const
Definition: qstring.h:848
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:5092
QString & fill(QChar c, qsizetype size=-1)
Definition: qstring.cpp:5973
QString & replace(qsizetype i, qsizetype len, QChar after)
Definition: qstring.cpp:3450
qlonglong toLongLong(bool *ok=nullptr, int base=10) const
Definition: qstring.cpp:7127
qulonglong toULongLong(bool *ok=nullptr, int base=10) const
Definition: qstring.cpp:7169
void chop(qsizetype n)
Definition: qstring.cpp:5955
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:7672
void truncate(qsizetype pos)
Definition: qstring.cpp:5934
ushort toUShort(bool *ok=nullptr, int base=10) const
Definition: qstring.h:846
qsizetype size() const
Definition: qstring.h:413
uint toUInt(bool *ok=nullptr, int base=10) const
Definition: qstring.h:850
QString rightJustified(qsizetype width, QChar fill=QLatin1Char(' '), bool trunc=false) const
Definition: qstring.cpp:6557
SectionFlag
Definition: qstring.h:558
@ SectionSkipEmpty
Definition: qstring.h:560
QString section(QChar sep, qsizetype start, qsizetype end=-1, SectionFlags flags=SectionDefault) const
Definition: qstring.h:1272
static QString fromRawData(const QChar *, qsizetype size)
Definition: qstring.cpp:8938
QString first(qsizetype n) const
Definition: qstring.h:576
QString simplified() const &
Definition: qstring.h:627
long toLong(bool *ok=nullptr, int base=10) const
Definition: qstring.h:852
const QChar at(qsizetype i) const
Definition: qstring.h:1212
float toFloat(bool *ok=nullptr) const
Definition: qstring.cpp:7409
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:5143
short toShort(bool *ok=nullptr, int base=10) const
Definition: qstring.h:844
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
Definition: qstring.cpp:6263
QString & insert(qsizetype i, QChar c)
Definition: qstring.cpp:3043
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=QLatin1Char(' ')) const
Definition: qstring.cpp:8318
QString toLower() const &
Definition: qstring.h:611
QChar * data()
Definition: qstring.h:1228
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:1353
static QString number(int, int base=10)
Definition: qstring.cpp:7538
QString sliced(qsizetype pos) const
Definition: qstring.h:580
QString & append(QChar c)
Definition: qstring.cpp:3152
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:4197
QString trimmed() const &
Definition: qstring.h:623
QString & setNum(short, int base=10)
Definition: qstring.h:1245
ulong toULong(bool *ok=nullptr, int base=10) const
Definition: qstring.h:854
QString & remove(qsizetype i, qsizetype len)
Definition: qstring.cpp:3252
QString toUpper() const &
Definition: qstring.h:615
void resize(qsizetype size)
Definition: qstring.cpp:2670
The QStringList class provides a list of strings.
The QStringView class provides a unified view on UTF-16 strings with a read-only subset of the QStrin...
Definition: qstringview.h:122
The QTextStream class provides a convenient interface for reading and writing text.
Definition: qtextstream.h:62
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:133
int y
the y coordinate of the widget relative to its parent and including any window frame
Definition: qwidget.h:144
void show()
Definition: qwidget.cpp:7825
Definition: widget.h:60
void toLowerFunction()
Definition: main.cpp:850
QString boolToString(bool b)
[7]
Definition: main.cpp:210
void toShortFunction()
Definition: main.cpp:858
void containsFunction()
Definition: main.cpp:340
void slicedFunction()
Definition: main.cpp:502
void stringLiteral()
Definition: main.cpp:174
void arrayOperator()
Definition: main.cpp:949
void compareFunction()
Definition: main.cpp:318
void sprintfFunction()
Definition: main.cpp:758
void toFloatFunction()
Definition: main.cpp:803
void rightJustifiedFunction()
Definition: main.cpp:634
void prependFunction()
Definition: main.cpp:520
void fromRawDataFunction()
Definition: main.cpp:389
void splitFunction()
Definition: main.cpp:709
void toUpperFunction()
Definition: main.cpp:913
void appendFunction()
Definition: main.cpp:236
void chopFunction()
Definition: main.cpp:309
void dataFunction()
Definition: main.cpp:356
void compareSensitiveFunction()
Definition: main.cpp:325
void trimmedFunction()
Definition: main.cpp:921
void constCharPointer()
Definition: main.cpp:134
void argFunction()
Definition: main.cpp:251
void atFunction()
Definition: main.cpp:162
void toDoubleFunction()
Definition: main.cpp:776
void nullVsEmpty()
[7]
Definition: main.cpp:222
void characterReference()
Definition: main.cpp:149
void lastFunction()
Definition: main.cpp:626
void startsWithFunction()
Definition: main.cpp:767
void isEmptyFunction()
Definition: main.cpp:440
void toIntFunction()
Definition: main.cpp:818
void setNumFunction()
Definition: main.cpp:682
void splitCaseSensitiveFunction()
Definition: main.cpp:733
void countFunction()
Definition: main.cpp:348
void modify()
Definition: main.cpp:186
void firstFunction()
Definition: main.cpp:481
void index()
Definition: main.cpp:196
void replaceFunction()
Definition: main.cpp:551
void insertFunction()
Definition: main.cpp:431
void plusEqualOperator()
Definition: main.cpp:939
void toUIntFunction()
Definition: main.cpp:869
void simplifiedFunction()
Definition: main.cpp:690
void resizeFunction()
Definition: main.cpp:602
void sizeFunction()
Definition: main.cpp:699
void toUShortFunction()
Definition: main.cpp:902
void leftJustifiedFunction()
Definition: main.cpp:489
Widget(QWidget *parent=nullptr)
void toLongFunction()
Definition: main.cpp:828
void truncateFunction()
Definition: main.cpp:930
void removeFunction()
Definition: main.cpp:530
void fillFunction()
Definition: main.cpp:377
void sectionFunction()
Definition: main.cpp:647
void isNullFunction()
Definition: main.cpp:450
void endsWithFunction()
Definition: main.cpp:368
void reserveFunction()
Definition: main.cpp:585
void indexOfFunction()
Definition: main.cpp:406
void toLongLongFunction()
Definition: main.cpp:839
void toULongLongFunction()
Definition: main.cpp:891
void toULongFunction()
Definition: main.cpp:880
void firstIndexOfFunction()
Definition: main.cpp:418
void constCharArray()
Definition: main.cpp:141
void numberFunction()
Definition: main.cpp:511
void lastIndexOfFunction()
Definition: main.cpp:459
int main(int argc, char **argv)
Definition: main.cpp:1
QOpenGLWidget * widget
[1]
QString str
[2]
@ CaseInsensitive
Definition: qnamespace.h:1283
@ CaseSensitive
Definition: qnamespace.h:1284
@ SkipEmptyParts
Definition: qnamespace.h:153
Q_CORE_EXPORT Q_DECL_PURE_FUNCTION int compareStrings(QStringView lhs, QStringView rhs, Qt::CaseSensitivity cs=Qt::CaseSensitive) noexcept
#define QString()
Definition: parse-defines.h:51
unsigned long ulong
Definition: qglobal.h:335
unsigned long long quint64
Definition: qglobal.h:299
ptrdiff_t qsizetype
Definition: qglobal.h:308
unsigned int uint
Definition: qglobal.h:334
long long qint64
Definition: qglobal.h:298
unsigned short ushort
Definition: qglobal.h:333
#define qDebug
[1]
Definition: qlogging.h:177
GLboolean GLboolean GLboolean b
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLboolean r
[2]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum condition
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLfloat n
GLint y
GLuint GLfloat * val
Definition: qopenglext.h:1513
GLdouble GLdouble t
[9]
Definition: qopenglext.h:243
GLsizei const GLchar *const * path
Definition: qopenglext.h:4283
GLuint64EXT * result
[6]
Definition: qopenglext.h:10932
GLdouble s
[6]
Definition: qopenglext.h:235
GLubyte * pattern
Definition: qopenglext.h:2744
#define QStringLiteral(str)
QApplication app(argc, argv)
[0]
QStringList list
[0]
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:53
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent