Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将在 QTextBroswer 推送到剪贴板之前替换它们中的一些内容。所以我应该重新实现copy(). 但是,PyQt 不会调用我的重载方法。怎么了?
copy()
from PyQt4 import QtCore, QtGui class Label(QtGui.QTextBrowser): @QtCore.pyqtSlot() def copy(self): # Never been called. print("Called")
QTextBrowser.copy() 是一个槽而不是一个虚函数,所以你必须小心重新实现它。请看看这个帖子,这可能对你有帮助。