Skip to content

KDAB on Qt Get the RSS Feed

Posts about Qt, for feeds like planetqt and planetkde

Getting rid of “volatile” in (some of) Qt

The upcoming version of the C++ Standard (C++2a) is proposing to deprecate certain usages of the volatile keyword, by adopting the P1152 proposal (Deprecating volatile). Despite the somewhat “flamboyant” title, the actual deprecated parts are very limited and indeed the paper limits the deprecation to somehow language/library corner cases and/or dangerous antipatterns. For instance certain […]

How not to lose the alpha channel when converting between QRgb/QColor/QString

Working on color imagery for QiTissue recently, I realized we were accidentally losing the alpha channel in multiple places. For efficiency reasons, we keep colors in memory using the QRgb type, and convert that to/from QString for serialization purposes via QColor as needed. Here’s what I discovered about why that doesn’t work, and some ways […]