[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: Argument issue in QCompleter
From: Phil Thompson <phil () riverbankcomputing ! com>
Date: 2021-07-09 13:38:58
Message-ID: fadb95792472f1782ffea9a7c084040c () riverbankcomputing ! com
[Download RAW message or body]
On 09/07/2021 07:40, Gottfried Müller wrote:
> Hello,
>
> in the Qt documentation the parent argument is a keyword. Creating an
> instance with QCompleter(QStandardItemModel, parent=parentObj) brings
> an
> error.
>
> I am using Python 3.9.5 and PyQt5 5.15
>
>
> Here my code:
>
> import sys
> from PyQt5.QtWidgets import QApplication, QWidget, QCompleter
> from PyQt5.QtGui import QStandardItemModel
>
> class ApplWindow(QWidget):
>
> def __init__(self, parent=None):
> super().__init__(parent)
> QCompleter(["aaaa", "bbbb"], parent=self)
> # the following statement has the execution error:
> # TypeError: 'parent' is an unknown keyword argument
> #QCompleter(QStandardItemModel(parent=self), parent=self)
> # this statement is accepted
> QCompleter(QStandardItemModel(parent=self), self)
>
> def main():
> appl = QApplication(sys.argv)
> applWindow = ApplWindow()
> applWindow.show()
> return appl.exec_()
>
> if __name__ == "__main__":
> main()
It will be fixed in the next PyQt5 and PyQt6 snapshots.
Thanks,
Phil
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic