本文整理汇总了Python中PyQt4.QtCore.qDebug方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.qDebug方法的具体用法?Python QtCore.qDebug怎么用?Python QtCore.qDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore
的用法示例。
在下文中一共展示了QtCore.qDebug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initMap
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def initMap(self):
QtCore.qDebug('sim_map.Map.initMap')
self.timer = QtCore.QBasicTimer()
self.setFrameStyle(QtGui.QFrame.Panel | QtGui.QFrame.Raised)
self.objects = []
self.setFocusPolicy(QtCore.Qt.StrongFocus)
self.setFixedSize(Map.MapWidth, Map.MapHeight)
self.isStarted = False
self.isPaused = False
self.clearMap()
self.dragXstart = -1
self.dragYstart = -1
self.dragXend = -1
self.dragYend = -1
self.dragObject = None
self.mouseActionType = Map.NoAction
self.saveToImage = True
self.mapChanged = False
self.robot = None
self.target = None
self.vbox = QtGui.QVBoxLayout()
self.setLayout(self.vbox)
self.simStats = SimStats(self)
示例2: runEaters
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def runEaters(self):
QtCore.qDebug('eaters.Eaters.newMap')
self.placeholder = Placeholder(self)
self.setCentralWidget(self.placeholder)
示例3: Main
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def Main():
app = QtGui.QApplication(sys.argv)
app.setWindowIcon(QtGui.QIcon(QtGui.QPixmap(":/ts2.png")))
qtTranslator = QtCore.QTranslator()
qtTranslator.load("qt_" + QtCore.QLocale.system().name(),
QtCore.QLibraryInfo.location(
QtCore.QLibraryInfo.TranslationsPath))
app.installTranslator(qtTranslator)
ts2Translator = QtCore.QTranslator()
ts2Translator.load(QtCore.QLocale.system(), "ts2", "_", "i18n", ".qm")
app.installTranslator(ts2Translator)
QtCore.qDebug(QtCore.QLocale.system().name())
try:
mw = mainwindow.MainWindow()
mw.show()
return app.exec_();
except:
gui.dialogs.ExceptionDialog.popupException(None)
#QMessageBox.critical(None,
#QObject.trUtf8(QObject(), "Error"),
#str(e),
#QMessageBox.StandardButtons(QMessageBox.Ok))
return 1
else:
return 0
示例4: saveMap
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def saveMap(self, confirmation = False):
QtCore.qDebug('simulator.Simulator.saveMap')
if (not self.placeholder is None) and (not self.placeholder.simMap is None) and self.placeholder.simMap.changed():
if self.fname.length() > 0:
msgBox = QtGui.QMessageBox();
msgBox.setText("The document has been modified.");
msgBox.setInformativeText("Do you want to save your changes?");
msgBox.setStandardButtons(QtGui.QMessageBox.Save |
QtGui.QMessageBox.Discard | QtGui.QMessageBox.Cancel);
msgBox.setDefaultButton(QtGui.QMessageBox.Save);
ret = msgBox.exec_();
if ret == QtGui.QMessageBox.Save:
self.placeholder.simMap.save(self.fname)
return True
elif ret == QtGui.QMessageBox.Discard:
return True
else:
return False
else:
fname = QtGui.QFileDialog.getSaveFileName(self, 'Save file map', '', 'Simulator maps (*.map)')
if fname.length() > 0:
self.fname = fname
self.setWindowTitle(self.fname)
if self.fname.length() > 0:
self.placeholder.simMap.save(self.fname)
print(self.fname)
return True
示例5: new_resource
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def new_resource(host, resource):
if resource.dev_type != 'tiqi.devil.channel':
return
# Close all the existing channels, if any.
nid = resource.dev_id
c = channels_for_dev_ids.get(nid, None)
if c:
QtC.qDebug(' :: Ignoring channel {}, already registered'.format(
nid))
return
QtC.qDebug(' :: Discovered new channel: {}'.format(resource))
if resource.version.major != 2:
QtC.qWarning(' :: Ignoring EVIL version {} @ {} ({})'.format(
resource.version, host, resource.display_name))
return
def on_disconnect():
channels_for_dev_ids.pop(nid)
node.broadcast_enumeration_request()
channels_for_dev_ids[nid] = Pusher(db, Evil2Channel(zmq_ctx, host,
resource),
on_disconnect)
示例6: listed
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def listed(self, _file):
if self._current_item is not None:
crc = self._current_item[0]
if crc in _file.name().toLower():
QtCore.qDebug("Found " + _file.name())
self._download(_file.name())
self._list_after_cd = False
示例7: meta_config
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def meta_config(ui, repo, **opts):
configFiles = ui.configlist('checkmeta', 'pattern_files',
default=os.path.join(repo.root, ".hgmeta"))
app = QtGui.QApplication(sys.argv)
for fileName in configFiles:
if not os.path.isfile(fileName):
# noinspection PyTypeChecker
choice = QtGui.QMessageBox.question(
None, _("File missing"), _("The file {0} doesn't exist,"
" create it?").format(fileName),
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
)
QtCore.qDebug(str(choice))
if choice == QtGui.QMessageBox.Yes:
# just create the file empty
with open(fileName, 'a'):
pass
else:
return
dialog = CheckConfigurationDialog(ui, configFiles)
dialog.show()
app.exec_()
示例8: handleMessage
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def handleMessage(self):
socket = self._server.nextPendingConnection()
if socket.waitForReadyRead(self._timeout):
self.emit(QtCore.SIGNAL('messageAvailable'),
QtCore.QString.fromUtf8(socket.readAll().data()))
socket.disconnectFromServer()
else:
QtCore.qDebug(socket.errorString().toLatin1())
示例9: _download
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def _download(self, _filename):
_local_filename = join(
unicode(self.config.value("save_files_to").toString()),
unicode(_filename))
_file = QtCore.QFile(_local_filename)
_file.open(QtCore.QIODevice.WriteOnly)
get = self.ftp.get(_filename, _file)
QtCore.qDebug("Getting %s" % _filename)
self._files[get] = _file
示例10: saveAsMap
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def saveAsMap(self):
QtCore.qDebug('simulator.Simulator.saveAsMap')
self.fname = QtGui.QFileDialog.getSaveFileName(self, 'Save file map as', '', 'Simulator maps (*.map)')
if fname.length() > 0:
self.fname = fname
self.placeholder.simMap.save(self.fname)
print(self.fname)
示例11: newMap
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def newMap(self):
QtCore.qDebug('simulator.Simulator.newMap')
self.fname = QtCore.QString('')
self.placeholder = Placeholder(self)
self.setWindowTitle('Untitled - Simulator')
self.setCentralWidget(self.placeholder)
self.placeholder.simMap.changedStatus[bool].connect(self.setChanged)
示例12: stateChanged
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def stateChanged(self, state):
"""docstring for stateChanged"""
if state == QtNetwork.QFtp.Connected:
QtCore.qDebug("Connected")
self.ftp.login(self.config.value("user").toString(),
self.config.value("password").toString())
if state == QtNetwork.QFtp.LoggedIn:
self.ftp.cd("Anime")
self._find_next_file()
QtCore.qDebug("Logged in")
示例13: start
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def start(self):
QtCore.qDebug('sim_map.Map.start')
if self.isPaused:
return
self.isStarted = True
self.clearMap()
self.msg2Statusbar.emit(str(0))
示例14: initUI
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def initUI(self):
QtCore.qDebug('sim_map.Map.initMap')
self.timer = QtCore.QBasicTimer()
self.setFrameStyle(QtGui.QFrame.Panel | QtGui.QFrame.Raised)
self.setFocusPolicy(QtCore.Qt.StrongFocus)
self.setFixedSize(Board.Width * GlobalConfig.BlockDim + 1, Board.Height * GlobalConfig.BlockDim + 1)
self.isStarted = False
self.isPaused = False
self.boardStats = BoardStats(self)
示例15: _find_next_file
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qDebug [as 别名]
def _find_next_file(self):
"""docstring for download"""
if self._items is not None:
try:
self._current_item = self._items.popitem()
self._list_after_cd = True
QtCore.qDebug(self._current_item[1][0] + "/" +
self._current_item[1])
self.ftp.cd(self._current_item[1][0] + "/" +
self._current_item[1])
except KeyError:
self._clear()