[PyQt] why QCompleter(parent) is TransferBack?
phil at riverbankcomputing.com
Sat Nov 29 09:33:19 GMT 2014
On 29/11/2014 9:04 am, Yuya Nishihara wrote:
> I'm getting random crash around QCompleter. The production code is not
> but it roughly does:
> app = QApplication()
> window = QMainWindow()
> lineedit = QLineEdit(window)
> completer = QCompleter(window)
> I looked into PyQt source and found that QCompleter(parent) is not
> as TransferThis.
> QCompleter(QObject *parent /TransferBack/ = 0);
> QCompleter(QAbstractItemModel *model, QObject *parent
> /TransferThis/ = 0);
> QCompleter(const QStringList &list, QObject *parent /TransferThis/
> = 0);
> So I've changed the above code as follows, and it seems the crash no
> -completer = QCompleter(window)
> +completer = QCompleter(, window)
> Is there a reason for setting TransferBack only to QCompleter(parent) ?
No - it's a bug. Your fix is the correct one.
More information about the PyQt