当(并且仅当)退出我的应用程序时,这些(并且仅这些)重复的消息出现在命令提示符上:
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
这对我来说很奇怪,因为我从不在我的代码(或QThread)中使用QTimer.事实上,使用该应用程序不会发生任何错误或崩溃,因此实际上这不是一个真正的问题.这种情况发生在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功能.