本文整理汇总了Python中spyderlib.qt.QtCore.QByteArray类的典型用法代码示例。如果您正苦于以下问题:Python QByteArray类的具体用法?Python QByteArray怎么用?Python QByteArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QByteArray类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: send_ctrl_to_process
def send_ctrl_to_process(self, letter):
char = chr("abcdefghijklmnopqrstuvwxyz".index(letter) + 1)
byte_array = QByteArray()
byte_array.append(char)
self.process.write(byte_array)
self.process.waitForBytesWritten(-1)
self.shell.write(LOCALE_CODEC.toUnicode(byte_array), flush=True)
开发者ID:gyenney,项目名称:Tools,代码行数:7,代码来源:baseshell.py
示例2: mouseMoveEvent
def mouseMoveEvent(self, event):
"""Override Qt method"""
if event.buttons() == Qt.MouseButtons(Qt.LeftButton) and \
(event.pos() - self.__drag_start_pos).manhattanLength() > \
QApplication.startDragDistance():
drag = QDrag(self)
mimeData = QMimeData()
# Converting id's to long to avoid an OverflowError with PySide
if PY2:
ancestor_id = long(id(self.ancestor))
parent_widget_id = long(id(self.parentWidget()))
self_id = long(id(self))
else:
ancestor_id = id(self.ancestor)
parent_widget_id = id(self.parentWidget())
self_id = id(self)
mimeData.setData("parent-id", QByteArray.number(ancestor_id))
mimeData.setData("tabwidget-id",
QByteArray.number(parent_widget_id))
mimeData.setData("tabbar-id", QByteArray.number(self_id))
mimeData.setData("source-index",
QByteArray.number(self.tabAt(self.__drag_start_pos)))
drag.setMimeData(mimeData)
drag.exec_()
QTabBar.mouseMoveEvent(self, event)
开发者ID:MarvinLiu0810,项目名称:spyder,代码行数:25,代码来源:tabs.py
示例3: read_output
def read_output(self, error=False):
if error:
self.process.setReadChannel(QProcess.StandardError)
else:
self.process.setReadChannel(QProcess.StandardOutput)
qba = QByteArray()
while self.process.bytesAvailable():
if error:
qba += self.process.readAllStandardError()
else:
qba += self.process.readAllStandardOutput()
text = to_text_string( locale_codec.toUnicode(qba.data()) )
if error:
self.error_output += text
else:
self.output += text
开发者ID:alfonsodiecko,项目名称:PYTHON_DIST,代码行数:16,代码来源:profilergui.py
示例4: mouseMoveEvent
def mouseMoveEvent(self, event):
"""Override Qt method"""
if event.buttons() == Qt.MouseButtons(Qt.LeftButton) and \
(event.pos() - self.__drag_start_pos).manhattanLength() > \
QApplication.startDragDistance():
drag = QDrag(self)
mimeData = QMimeData()
mimeData.setData("parent-id", QByteArray.number(id(self.ancestor)))
mimeData.setData("tabwidget-id",
QByteArray.number(id(self.parentWidget())))
mimeData.setData("tabbar-id", QByteArray.number(id(self)))
mimeData.setData("source-index",
QByteArray.number(self.tabAt(self.__drag_start_pos)))
drag.setMimeData(mimeData)
drag.exec_()
QTabBar.mouseMoveEvent(self, event)
开发者ID:jromang,项目名称:retina-old,代码行数:16,代码来源:tabs.py
注:本文中的spyderlib.qt.QtCore.QByteArray类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论