Quite a frustrating time

Is being had by me. An unpleasant cold, a completely unrealistic deadline at work and the need to do some serious studying conspire against working on Krita. But that’s no news. The big problem this time is that I blithely assumed I would be able to take Kivio’s docker implementation and use that KOffice-wide.

In this assumption, I was absolutely correct. Where I went wrong was in assuming that fixing the slight problems and deficiencies in those dockers would be, what we Dutch call, a ‘fluitje van een cent’. (Literally, a penny-whistle. Why my nation assumes that playing a penny-whistle is easy, I don’t know. It’s dashed hard to get an agreeable sound out of them.).

The Kivio dockers have two or three main problems. First, they only do their sliding dance into the borders of the view when you move the docker a little or resize it a bit after positioning them against the border. Second, they cannot be dragged outside their parent window. Third, they don’t remember their last position. And there are a few wishes: double-clicking on the grab-bar should shade and unshade the docker, dragging a tab from one docker to another should be possible, and dockers should snap to each other if they are overlapping.

Of course, there are good points too: dragging a docker from a docked position to a floating position is smooth, the docker doesn’t jump to 10,10 inside the view like a QDockWindow and since the dockers are not toplevel windows, not even when free-floating, they don’t take focus from the application, meaning that if you click on a brush focus doesn’t get taken away from the view and all your shortcuts still work.

By comparison, QDockWindow and descendants don’t remember their position when floating either, do take focus away when floating, jump to 10,10 when undocking and when the last docker is undocked, the canvas suddenly resizes. But the mere fact that QDockWindow is unsatisfactory should have warned me that the problem could be hard, maybe even too hard for me, and at the very least time-consuming. I really should live according to the first rule of UI-coding: never create a custom widget if you can help it at all. At most, if doing something fancy, a single custom widget to represent your data. If the library fails you, bear with it.

Now I’m trying to experiment with hiding the Kivio dockers behind an interface so I can make one that uses QDockWindow, and one that is purely experimental. Of course, that means I run into the problem that you cannot have an interface that has slots and signals (and thus inherits QObject), and have one descendant that inherits QWidget and one that inherits QDockWindow. Oh well… I need to fix this first, before going on with the real useful work, like selections…