python类clipboard()的实例源码

fygui.py 文件源码 项目:dayworkspace 作者: copie 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def __init__(self):
        self.app = QApplication(sys.argv)
        self.mainWindow = QMainWindow()
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self.mainWindow)

        self.Dialog = QtWidgets.QDialog()
        self.ui2 = Ui_Form()
        self.ui2.setupUi(self.Dialog)

        self.ui.textEdit.setReadOnly(True)
        self.clipboard = QApplication.clipboard()
        self.clipboard.selectionChanged.connect(self.fanyi)
        self.mainWindow.setWindowTitle("????")
        self.mainWindow.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
        self.ui2.lineEdit.editingFinished.connect(self.callInput)
        self.Dialog.moveEvent = self.mainMove
        self.wordutil = wordutil()
        self.time = time.time()
        self.ui.textEdit.mouseDoubleClickEvent = self.inputText
fygui.py 文件源码 项目:dayworkspace 作者: copie 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def fanyi(self):
        if time.time() - self.time < 0.1:
            print("???")
            return
        self.time = time.time()
        if self.ui.textEdit.hasFocus():
            return
        text = self.clipboard.text(self.clipboard.Selection)
        if len(text) > 20:
            return
        self.mainWindow.move(*self._position())
        texttmp = ""
        for c in text:
            if c.isupper():
                texttmp += " " + c
            else:
                texttmp += c
        text = texttmp
        text = text.strip(' ')
        if text != '':
            text = self.wordutil.execfind(text)
            self.ui.textEdit.clear()
            self.ui.textEdit.insertHtml(text)
dialogs.py 文件源码 项目:TrezorSymmetricFileEncryption 作者: 8go 项目源码 文件源码 阅读 41 收藏 0 点赞 0 评论 0
def selectionChanged(self):
        """
        called whenever selected text in textarea is changed
        """
        # self.textBrowser.copy()  # copy selected to clipboard
        # self.settings.mlogger.log("Copied text to clipboard: %s" % self.clipboard.text(),
        #   logging.DEBUG, "Clipboard")
        pass
dialogs.py 文件源码 项目:TrezorSymmetricFileEncryption 作者: 8go 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def copy2Clipboard(self):
        self.textBrowser.copy()  # copy selected to clipboard
        # This is content from the Status textarea, so no secrets here, we can log it
        self.settings.mlogger.log("Copied text to clipboard: %s" % self.clipboard.text(),
            logging.DEBUG, "Clipboard")
band_graph.py 文件源码 项目:gpvdm 作者: roderickmackenzie 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def do_clip(self):
        buf = io.BytesIO()
        self.my_figure.savefig(buf)
        QApplication.clipboard().setImage(QImage.fromData(buf.getvalue()))
        buf.close()
plot_widget.py 文件源码 项目:gpvdm 作者: roderickmackenzie 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def do_clip(self):
        buf = io.BytesIO()
        self.fig.savefig(buf)
        QApplication.clipboard().setImage(QImage.fromData(buf.getvalue()))
        buf.close()
attrs_widget.py 文件源码 项目:opcua-widgets 作者: FreeOpcUa 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def _copy_value(self, position):
        it = self.get_current_item(1)
        if it:
            QApplication.clipboard().setText(it.text())
tree_widget.py 文件源码 项目:opcua-widgets 作者: FreeOpcUa 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def copy_path(self):
        path = self.get_current_path()
        path_str = ",".join(path)
        QApplication.clipboard().setText(path_str)
tree_widget.py 文件源码 项目:opcua-widgets 作者: FreeOpcUa 项目源码 文件源码 阅读 31 收藏 0 点赞 0 评论 0
def copy_nodeid(self):
        node = self.get_current_node()
        text = node.nodeid.to_string()
        QApplication.clipboard().setText(text)
mainwindow.py 文件源码 项目:persepolis 作者: persepolisdm 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def dropEvent(self, droplink):
        link_clipborad = QApplication.clipboard()
        link_clipborad.clear(mode=link_clipborad.Clipboard)
        link_string = droplink.mimeData().text()
        link_clipborad.setText(str(link_string), mode=link_clipborad.Clipboard)
        self.addLinkButtonPressed(button=link_clipborad)

# aria2 identifies each download by the ID called GID.
# The GID must be hex string of 16 characters,
# thus [0-9a-zA-Z] are allowed and leading zeros must 
# not be stripped. The GID all 0 is reserved and must
# not be used. The GID must be unique, otherwise error 
# is reported and the download is not added.
# gidGenerator generates GID for downloads


问题


面经


文章

微信
公众号

扫码关注公众号