From e8beeb6767b387204fcaae4a066f226ca37f8a82 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 15 Mar 2020 21:51:27 +0100 Subject: desktop: properly initialize activeText of model-delegates For reasons that I don't understand, we keep track of the current combo-box text for our model-delegates. However, that text was not initialized when the editor was generated, leading to a UI bug in the cylinder and weight widgets: Activate a field, click somewhere else -> either the empty string or the previous string was set. Reported-by: Robert C. Helling Signed-off-by: Berthold Stoeger --- desktop-widgets/modeldelegates.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/desktop-widgets/modeldelegates.cpp b/desktop-widgets/modeldelegates.cpp index 65e8f377e..d7dd28b0e 100644 --- a/desktop-widgets/modeldelegates.cpp +++ b/desktop-widgets/modeldelegates.cpp @@ -129,6 +129,7 @@ QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewI currCombo.comboEditor = comboDelegate; currCombo.currRow = index.row(); currCombo.model = const_cast(index.model()); + currCombo.activeText = currCombo.model->data(index).toString(); keyboardFinished = false; // Current display of things on Gnome3 looks like shit, so -- cgit v1.2.3-70-g09d2