This is a short introduction to Qt using a simple demo script. We play around with strings and look into the issue how to present them.
Let’s get started.
Main function
- #include <QtCore>
- int main(int argc, char **argv)
- {
- // sample code goes here
- }
Fun with Strings
- qDebug() << s; // "Hello World"
This is easy.
List of Strings
- list << s1 << s2;
- qDebug() << list;
- // or
- list = s.split(" "); // "Hello World" => ["Hello", "World"]
QStringList
- QDebug() << s << " => " << list; << " => " << s2; // "Hello World => ["Hello", "World"] => "Hello World!"

