[PyQt] Using drag+drop in a QComboBox

Chris Beaumont beaumont at hawaii.edu
Tue Oct 30 16:50:42 GMT 2012


Hi,

I'm having some trouble getting drag+drop to work properly within a
QComboBox widget. I've posted to SO:
http://stackoverflow.com/questions/13141143/pyqt4-items-disappear-when-using-drag-and-drop-with-qcombobox

I thought I'd try here as well. In short, I want to be able to rearrange
entries in a QComboBox with the mouse, but
the dragged items keep disappearing instead of moving. My code is pasted
below. Is there anything obviously wrong here?

Thanks,
Chris


from PyQt4.QtGui import QApplication, QComboBox, QAbstractItemView

a = QApplication([''])
c = QComboBox()
c.addItem('a')
c.addItem('b')
c.addItem('c')
c.addItem('d')

view = c.view()
view.setDragDropMode(QAbstractItemView.InternalMove)

c.show()
c.raise_()
a.exec_()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20121030/66525c02/attachment.html>


More information about the PyQt mailing list