QTimer在linux设置实时线程,为什么我的"QTimer只能用于以QThread开头的线程"消息,如果我的代码中没有QTimer?...

当(并且仅当)退出我的应用程序时,这些(并且仅这些)重复的消息出现在命令提示符上:

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功能.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值