當前位置: 首頁>>代碼示例>>Python>>正文


Python QtCore.QByteArray類代碼示例

本文整理匯總了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;未經允許,請勿轉載。