Composition and aggregation with QObject
Consider these rather simple relationships between classes Continuing on this subject, here are some code examples. Class1 & Class2: Composition An instance of Class1 can not exist without an...
View ArticleLoading truly truly huge text files with a QAbstractListModel
Sometimes people want to do crazy stuff like loading a gigabyte sized plain text file into a Qt view that can handle QAbstractListModel. Like for example a QML ListView. You know, the kind of files you...
View ArticleTruly huge files and the problem of continuous virtual address space
As we all know does mmap, or even worse on Windows CreateFileMapping, need contiguous virtual address space for a given mapping size. That can become a problem when you want to load a file of a...
View ArticleHow to expose a QList in a ViewModel to QML
MyPlugin/MyPlugin.cpp: #include <ViewModels/MyListClass.h> #include <ViewModels/DisplayViewModel.h> qmlRegisterUncreatableType<MyListClass>( a_uri, 1, 0, "MyListClass", "Use access...
View ArticleDuck typing
Imagine you have a duck. Imagine you have a wall. Now imagine you throw the duck with a lot of force against a wall. Duck typing means that the duck hitting the wall quacks like a duck would. ps....
View ArticlePerfection
Perfection has been reached not when there is nothing left to add, but when there is nothing left to take away.
View ArticleMaking something that is ‘undoable editable’ with Qt
Among the problems we’ll face is that we want asynchronous APIs that are undoable and that we want to switch to read only, undoable editing, non-undoable editing and that QML doesn’t really work well...
View ArticleAsynchronous undoable and redoable APIs
Combining QFuture with QUndoCommand made a lot of sense for us. The undo and the redo methods of the QUndoCommand can also be asynchronous, of course. We wanted to use QFuture without involving...
View ArticleHow do they do it? Asynchronous undo and redo editors
Imagine we want an editor that has undo and redo capability. But the operations on the editor are all asynchronous. This implies that also undo and redo are asynchronous operations. We want all this to...
View ArticleColleague tells me I write blogs in chats while I explain how to write a...
I’m at home now. I don’t do non-public unpaid work. So let’s blog the example I’m making for him. workplace.h #ifndef Workplace_H #define Workplace_H #include <QObject> #include <QFuture>...
View ArticleAbstractCommand Model View ViewModel techniques
In the .NET XAML world, you have the ICommand, the CompositeCommand and the DelegateCommand. You use these commands to in a declarative way bind them as properties to XAML components like menu items...
View ArticleThe RelayCommand in Qt
A few days ago I explained how we can do MVVM techniques like ICommand in Qt. Today I’ll explain how to make and use a simple version of the, in the XAML MVVM world quite famous, RelayCommand. In the...
View ArticleAsynchronous commands
With asynchronous commands we have typical commands from the Model View ViewModel world that return asynchronously. Whenever that happens we want result reporting and progress reporting. We basically...
View ArticleMetaclasses, generative C++
This is awesome: Youtube-link Youtube-link Youtube-link Paper on the proposal Blog about it by Herb Sutter Live demo with Clang
View ArticleDoing it right, making libraries using popular build environments
Enough with the political posts! Making libraries that are both API and libtool versioned with qmake, how do they do it? I started a project on github that will collect what I will call “doing it...
View ArticleDoing It Right examples on autotools, qmake, cmake and meson
About I finished my earlier work on build environment examples. Illustrating how to do versioning on shared object files right with autotools, qmake, cmake and meson. You can find it here. The DIR...
View ArticleAvast, Qt6 announcing new QPromise and QFuture APIs
Qt published its New_Features in Qt 6.0. Some noteworthy items in their list: QPromise allows setting values, progress and exceptions to QFuture QFuture supports attaching continuations I like to think...
View ArticleImproving Qt
We are a few years further. A few years in which we all tried to make a difference. I’m incredibly proud of my achievement of QTBUG-61928. At the time I thought I could never convince the Qt...
View ArticleThe bypass paywalls on a phone
Bypassing paywalls is a sport for some. And it ain’t hard for Desktop Browsers. Just install a addon in your favorite Desktop Browser. Unfortunately this didn’t work on a Android or iPhone phone. Nor...
View Article