仅当我退出应用程序时,这些(且仅这些)重复的消息才会出现在命令提示符上:
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
这对我来说相当奇怪,因为我从未在我的代码中使用过QTimer(或QThread)。 实际上,使用应用程序时没有发生任何错误或崩溃,所以这实际上不是一个真正的问题。 这种情况在Windows和Linux操作系统中都会发生。
我所有的导入:
from __future__ import print_function
from PyQt4.QtGui import (QApplication, QMainWindow,
QFileSystemModel, QTreeView, QTableView,
QAbstractItemView, QMenu, QAction, QKeyEvent)
from PyQt4.QtCore import QDir, Qt, SIGNAL, QString, QFileInfo, QCoreApplication
import sys
主要功能:
def main():
app = QApplication(sys.argv)
app.setApplicationName("QFM")
app.setStyle("plastique")
gui = MainWindow()
gui.show()
app.exec_()
也许与QFileSystemWatcher有关(被QFileSystemModel使用),我猜测......也许它使用了一些QTimer的特性。