python中关于获取鼠标坐标的问题


import sys
from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5.QtChart import QChart, QChartView, QLineSeries, QValueAxis
from PyQt5 import QtCore, QtGui

class MainWindow(QMainWindow):
    class ChartView(QChartView):
        def __init__(self, chart):
            super().__init__(chart)        

        def mouseMoved(self, event):
        pos = event[0]

提示出错:TypeError: 'QPointF' object is not subscriptable

pos = (event.x,event.y)

何必这么麻烦,直接import pyautogui就完事了。
x,y=pyautogui.position()