Skip to main content

QtWS17 - QStringViews, QStringViews everywhere, Marc Mutz, KDAB

The upcoming Qt 5.10 release will see the biggest revolution in Qt string handling since Qt 2 added support for Unicode strings: QStringView. Deceptively simple, string views are a powerful abstraction of Unicode string data from the owning container. String views will permeate all of Qt’s APIs within the next few releases and into Qt 6, and release the developer from the requirement to create QStrings just to hand Unicode strings to Qt APIs. This talk will introduce you to the new idioms forming around QStringView, enabling you to take full advantage of the Qt string APIs in 5.10 and beyond. We will also explore patterns useful for evolving your own APIs to embrace QStringView. Finally, we will take a look at QLatin1String/QStringView co-evolution and the proposed QUtf8String class. The talk assumes some knowledge of the current Qt string APIs, but should be accessible to anyone who ever worked with string classes in object-oriented languages.