[PyQt] QItemDelegate createEditor - help with focusOut on custom widget
James Holstead
jamesholstead at gmail.com
Mon Aug 22 15:52:54 BST 2011
Greetings,
OS X 10.5.8
PyQT 4.8.3
I created a widget PathWidget which has a QGridLayout that contains 3
QComboBox's. This widget is only displayed in a specific column of a
QTableView using the createEditor method override of the QItemDelegate. We
started experiencing that the application crashes if someone uses this
widget and subsequently presses a copy button which basically copies all the
model's data and re-inits the main form widget and all its
children(including this table and item delegate).
What I noticed was this PathWidget, after being initialized, would not loose
focus unless the user clicked another object in the same TableView object.
The delegated PathWidget would still exist for that column when the user
clicked the copy button, somewhere causing a seg fault. Other components the
ItemDelegate creates, such as QComboBox and QLineEdit, loose focus and are
gc'd when the copy button is clicked.
Do I need to redefine any of the focus events for the PathWidget, and/or
perhaps set a proxy focus or policy?
Thank you,
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20110822/fb13d9d2/attachment.html>
More information about the PyQt
mailing list