KDAB has long supported the C++ community, as C++ is the backbone of Qt and up-to-date knowledge of its changes keeps us on the leading edge in the Qt world. Later this year we shall be supporting Europe’s Meeting C++ in Berlin, but now that this year’s talks have been released we felt it was […]
C++ Get the RSS Feed
Content related to C++
Tuple And Pair in C++ APIs? A Simple Design Goal to Improve Your C++ APIs
Quick: When you design C++ APIs, when and how should you use pair and tuple? The answer is as simple as it is surprising: Never. Ever. When we design APIs, we naturally strive for qualities such as readability, ease-of-use, and discoverability. Some C++ types are enablers in this regard: std::optional, std::variant, std::string_view/gsl::string_span, and, of course, […]
KDAB talks at QtCon 2016
Hello! This is a small wrap-up fromQtCon, the biggest Qt event in Europe in 2016, that happened at the beginning of September. At QtCon the Qt community joined forces with the KDE, FSFE and VideoLAN communities, to create an exciting event in the spirit of open collaboration and participation amongst projects. During QtCon many KDAB […]
CppCon and Qt
KDAB was proud to sponsor CppCon this year, continuing to foster the Qt / C++ connection, talking about Qt and soaking up the immense range of C++ knowledge on display. KDAB’s Giuseppe D’Angelo gave a much appreciated, two-day Qt Widgets training as a pre-conference class, a condensed version of one of our scheduled Qt trainings, […]
Goodbye, Q_FOREACH A porting guide to C++11 ranged for-loops
Q_FOREACH (or the alternative form, foreach) will be deprecated soon, probably in Qt 5.9. Starting with Qt 5.7, you can use the QT_NO_FOREACH define to make sure that your code does not depend on Q_FOREACH. You may have wondered what all the fuss is about. Why is there a continuous stream of commits going to into Qt […]
Four Habit-Forming Tips to Faster C++
Are you a victim of premature pessimisation? Here’s a short definition from Herb Sutter: Premature pessimization is when you write code that is slower than it needs to be, usually by asking for unnecessary extra work, when equivalently complex code would be faster and should just naturally flow out of your fingers. Despite how amazing today’s […]
Very explicit operator bool Is the Safe Bool Idiom still useful in C++11 / C++14?
From time to time I scroll through Qt-related forums and mailing lists, and whenever possible I try to help fellow developers out. The other day a StackOverflow thread caught my attention: a developer was asking “What is the purpose of operator RestrictedBool in QScopedPointer?” Indeed, looking at QScopedPointer‘s implementation, one notices the strange RestrictedBool usage. […]
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 […]
QRegion will be iterable in Qt 5.8 - seamless integration with C++11 range-for
A novel solution to an old problem The QRegion class specifies a clip region for a painter. You can also query a QPaintEvent for the region() to limit the paint operations necessary in partial repaints. A region can be anything from a simple rectangle to a bitmap mask, but virtually all code that inspects a […]
KDAB contributions to Qt 5.6
Qt 5.6 has just been released! Packed with incredible new features, 5.6 is also the first long term support release of Qt: it will be supported for the next 3 years, giving developers a solid foundation for their current and upcoming projects. Once more, KDAB is confirmed to be the largest independent contributor to Qt, […]