Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/oop/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python QDateEdit对象没有属性“0”;setText";_Python_Oop_Pyqt5 - Fatal编程技术网

Python QDateEdit对象没有属性“0”;setText";

Python QDateEdit对象没有属性“0”;setText";,python,oop,pyqt5,Python,Oop,Pyqt5,我想创建一个日历,当我按下日历上的日期时,它会被复制到一些字段中。目前,我试图只填充一个字段,但出现错误“QDateEdit对象没有属性”setText 代码: 我正在尝试将从日历中选择的日期复制到self.GermanyDate 你知道我该怎么做吗?你必须传递一个QDate,而不是字符串: self.GermanyDate.setDate(self.calendar.selectedDate()) self.GermanyDate.setDate(self.calendar.selected

我想创建一个日历,当我按下日历上的日期时,它会被复制到一些字段中。目前,我试图只填充一个字段,但出现错误“QDateEdit对象没有属性”setText 代码:

我正在尝试将从日历中选择的日期复制到self.GermanyDate


你知道我该怎么做吗?

你必须传递一个QDate,而不是字符串:

self.GermanyDate.setDate(self.calendar.selectedDate())
self.GermanyDate.setDate(self.calendar.selectedDate())