If you’re following our Youtube channel you might have heard me talking about QVarLengthArray. If you’re not… you should follow us! But let me give you a quick recap. QVarLengthArray is a Qt container that acts like a vector; its elements are stored contiguously in memory and it has a dynamic size. At any time […]
Blog Archives
Qt World Summit 2019 talk videos are online
Did you miss the past Qt World Summit? Were you there, but you couldn’t attend that talk or two that you really wanted to see because the conference was so, so packed with awesome content? Fear no more! We are glad to announce that the talks at the past Qt World Summit 2019 in Berlin […]
A little hidden gem: QStringIterator
A few days ago Marc Mutz, colleague of mine at KDAB and also author in this blog, spotted this function from Qt’s source code (documentation): Apart from the mistake of considering empty strings not uppercase, which can be easily fixed, the loop in the body looks innocent enough. How would we figure out if a […]
KDAB Challenge Solutions Answers to KDAB’s 20 Years Developer Challenge
Task 1 View Task 1 Proxy types can be tricky. If we got a QChar (or a reference to a QChar) by accessing a character in a QString with the operator[] as most people would expect to, the automatic type deduction requested by auto current = hello[i] would deduce that current is of type QChar. […]
QStringView Diaries: Masters Of The Overloads How QStringView actively manages implicit conversions
The last blog post in this series described how to use string-views. This post is about how to design one. In particular, it’s about QStringView‘s constructors. They evolved through a rapid succession of changes. These changes either fixed ambiguities between QString and QStringView overloads, or improved performance. And they all have the same solution: std::enable_if, […]
QStringView Diaries: The Eagle Has Landed QStringView merged for Qt 5.10
After two months of intensive reviews, discussions, fixes, and stripping down the initial commit, feature by feature, to make it acceptable, I am happy to announce that the first QStringView commits have landed in what will eventually become Qt 5.10. Even the docs are already on-line. This is a good time to briefly recapitulate what […]
QStringView Diaries: Advances in QStringLiteral How QStringView Development Also Improves its "Competition"
This is the first in a series of blog posts on QStringView, the std::u16string_view equivalent for Qt. You can read about QStringView in my original post to the Qt development mailing-list, follow its status by tracking the “qstringview” topic on Gerrit and learn about string views in general in Marshall Clow’s CppCon 2015 talk, aptly […]
Faster than Fast String Search in Qt
Is your code burning a lot of cycles hunting for strings? Maybe you need to find the proper charset nestled in a chunk of HTML, or look for the dimensions in an XPM image file, or locate the email attachment boundaries in a block of MIME. If you string search a lot and performance is […]
Reducing relocations with Q_STRINGTABLE
Qt is a native library at the heart. As a native (C++) library, it already outperforms most higher-level language libraries when it comes to startup performance. But if you’re using native languages, you usually do so because you need to get the most out of the available hardware and being just fast may not be […]