TypeError:参数与任何重载调用都不匹配:

时间:2019-07-14 19:49:51

标签: python pyqt4 ubuntu-16.04

我是PyQt4的新手,我正在尝试在Ubuntu 16.04上使用VS代码终端运行此简单的GUI代码

首先,我遇到另一个错误,告诉我没有名为PyQt4的模块,因此我使用以下命令重新安装了该模块:

apt-cache search pyqt
sudo apt-get install python-qt4
sudo apt-get install python-qt4-doc

这是代码

import sys 
from PyQt4 import QtGui

class Window(QtGui.QMainWindow):
    def __init__(self):
        super(Window,self). __init__()
        self.setGeometry(50,50,1000.1000)
        self.setWindowTitle("MAP")
        self.show()

app = QtGui.QApplication(sys.argv)
GUI = Window()
sys.exit(app.exec_())

这是错误

 Traceback (most recent call last):
  File "map.py", line 15, in <module>
 GUI = Window()
 File "map.py", line 8, in __init__
 self.setGeometry(50,50,1000.1000)
 TypeError: arguments did not match any overloaded call:
  QWidget.setGeometry(QRect): argument 1 has unexpected type 'int'
  QWidget.setGeometry(int, int, int, int): not enough arguments

0 个答案:

没有答案