Category: Qt

CRecentLocationsDialog

Recent locations dialog is an improved version of standard open/save file dialog. It features lists of 100 most recently accessed folders and files for easier navigation among commonly used resources. Double-clicking on a folder item or selecting an item from the folders list and clicking Browse button below launches a […]

Long-lost Qt Goodies – QArrowCue

Have you ever wanted to indicate (in a more pronounced way than usual mouse cursor change) that a drag action is taking place? Now is your chance to do just that 🙂 Thanks to QArrowCue you can display a neat arrow for any QDrag object you have out there. I’ll […]

Long-lost Qt Goodies – QPieMenu

I bet every single coder out there has some long-forgotten pieces of code, which when rediscovered bring this “WTH. I wrote that?” kind of feeling. I happen to have a lot of such candies 😉 Today, it’s an eye-appealing one – a pie menu. Nothing too innovative, but quite useful […]

Recording and replaying Qt input events

Recording, saving, loading and replaying of Qt input events could come in handy in numerous situations. For example, in automatic GUI testing or when implementing a macro system (like the one in Microsoft Office or Adobe Photoshop), in interactive help systems, demos of all sorts etc. Input events in Qt […]

Efficient Meta-Information Based Binary Parser

The problem of storing information about structure of binary data seems quite prevalent nowadays. As tendency to use non-homogenous programming platforms increases, a need arises to store information about data (meta-information) separately from code and in a format that facilitates extensibility and portability. Such architecture could be illustrated using the […]

QDomNodeModel / QXmlQuery

I have prepared an implementation of QAbstractXmlNodeModel class from QtXmlPatterns module which makes it possible to run QXmlQuery-ies on a QDomDocument. I’ve run into problems with QXmlQuery though, because it doesn’t seem to support @Attribute queries either in QXmlQuery::XPath20 or QXmlQuery::XQuery10 mode. I’ve tested it without my custom model and […]

Random thought – QObjectLocker

I figured it _could_ be useful to have my mutexes created automatically for me on a per object basis. QObjectLocker maintains a pool of mutexes assigned to specified addresses (object pointers) in memory. Otherwise it behaves similarly to QMutexLocker. This way I don’t have to extend or pair up existing […]

QBoundMethod Part 2

Today, I’d like to discuss the implementation of QBoundMethod in every detail. The core of all functionality is placed in QBoundMethod::construct() method. It is responsible for creating a copy of generic arguments provided as its parameters. For every QGenericArgument, a QVariant holding copy of the original data is created and […]

QBoundMethod

Bound method is usually defined as class method associated with an object (instance of the class). But what if we could extend this term a bit and bind methods not only to objects but to an arbitrary number of arguments as well? Let’s assume that if we have a method […]