Fix bug.
[maegirls] / trunk / src / win.py
index b90d3e9..d270aae 100755 (executable)
@@ -217,6 +217,8 @@ class GirlsDialog(QDialog):
        self.lst=QListView(self)
        self.lst.setModel(self.lstm)
 
+       self.lst.setProperty("FingerScrollable", True)
+
        self.l0.addWidget(self.lst)
 
        self.buttonNew=QPushButton(self)
@@ -263,7 +265,13 @@ class GirlsDialog(QDialog):
 
        # Set current selection
        idx=dt.index(current)
-       self.lst.setCurrentIndex(self.lstm.index(idx))
+
+       # Either I'm doing something stupid, or this is a QT bug
+       # The selection works but isn't shown
+       idx2=self.lstm.index(idx, 0)
+       self.lst.setCurrentIndex(idx2)
+       # Give if focus to show the current selection - is this normal?
+       self.lst.setFocus(Qt.OtherFocusReason)
 
        # Run
        QDialog.exec_(self)