ComboBox oddities..

Linus Torvalds torvalds at linux-foundation.org
Sun Sep 22 13:15:57 UTC 2013


Ok, I've been banging my head against the broken cylinder editing, and
I'm making no headway at all. The Qt ComboBox code is completely
incomprehensible.

I did make one discovery: I cna make the cylinder editing work if I
limit my input to a very specific case.

Anyway, let me explain what works first:
 - go to dive

 - select equipment tab

 - (if required, add cylinder)

 - select the "Type" entry with the mouse.

   This shows the first bug. If I already have a type (say, "AL80"),
when I select the type entry, I get the AL80 text garbled because it
writes it *twice*: there's the "AL80" text entry for the edit box (in
black), AND there is the AL80 selection entry from the combo box
(rendered in white on the blue selected box), and they render on top
of each other!

 - I can now press up/down keys on the keyboards, and that will show
the whole list of choices, and I can up/down to the right one and
press "enter" to select it. This works.

So the above is the *working* case, except for the rendering bug. It's
still somewhat annoying, because the *first* time you press up/down,
it won't change the entry, but will instead just show the list of
entries. But fine, it kind of works.

What doesn't work AT ALL for me is selecting an entry purely by the
mouse, which is actually the obvious way to do things. Let's walk
through that case:

 - go to dive

 - select equipment tab

 - (if required, add cylinder)

 - select the type entry with the mouse.

   This obviously shows the same garbled entry, since so far we're
doing exactly the same thing.

 - Press on the type entry again, to get the list of valid cylinder types.

 - pick a type.

   This does *not* work. It gets us back o the garbled output, but the
size/workpressure didn't actually change, and if you move out of the
window, the entry gets de-highlited (no longer in focus) and the
garbled state goes away, but it reverts to the previous state.

You can "save" the broken state by pressing "tab" when it is in the
garbled state, and that will apparently "select" it, and now fill in
the size/workpressure information. But just picking the entry with the
mouse doesn't work.

I don't understand why there have been so many problems with Qt
ComboBoxes. We must be doing something seriously wrong, because
there's no way any of the above is normal Qt behavior. But I have no
idea about Qt.

Anyway, equipment editing is extremely painful as-is. Never mind the
multi-dive issues (I think Tomaz said he implemented it, but I haven't
seen the code yet), even a single dive is very broken.

              Linus


More information about the subsurface mailing list