Removed an old workaround in the Qt version that doesn't seem to be needed with the current version of Qt.

This commit is contained in:
Virgil Dupras 2011-03-16 08:41:29 +00:00
parent 731e68f164
commit ebeb068042
1 changed files with 3 additions and 7 deletions

View File

@ -8,8 +8,8 @@
import urllib.parse
from PyQt4.QtCore import pyqtSignal, Qt, QRect, QEvent, QPoint, QUrl
from PyQt4.QtGui import (QComboBox, QStyledItemDelegate, QMouseEvent, QApplication, QBrush, QStyle,
from PyQt4.QtCore import pyqtSignal, Qt, QRect, QUrl
from PyQt4.QtGui import (QComboBox, QStyledItemDelegate, QApplication, QBrush, QStyle,
QStyleOptionComboBox, QStyleOptionViewItemV4)
from hscommon.trans import tr
@ -47,11 +47,7 @@ class DirectoriesDelegate(QStyledItemDelegate):
def setEditorData(self, editor, index):
value = index.model().data(index, Qt.EditRole)
editor.setCurrentIndex(value);
press = QMouseEvent(QEvent.MouseButtonPress, QPoint(0, 0), Qt.LeftButton, Qt.LeftButton, Qt.NoModifier)
release = QMouseEvent(QEvent.MouseButtonRelease, QPoint(0, 0), Qt.LeftButton, Qt.LeftButton, Qt.NoModifier)
QApplication.sendEvent(editor, press)
QApplication.sendEvent(editor, release)
# editor.showPopup() # this causes a weird glitch. the ugly workaround is above.
editor.showPopup()
def setModelData(self, editor, model, index):
value = editor.currentIndex()