当前位置: 首页>>代码示例>>Python>>正文


Python Qt.TextSelectableByMouse方法代码示例

本文整理汇总了Python中PyQt5.QtCore.Qt.TextSelectableByMouse方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.TextSelectableByMouse方法的具体用法?Python Qt.TextSelectableByMouse怎么用?Python Qt.TextSelectableByMouse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt5.QtCore.Qt的用法示例。


在下文中一共展示了Qt.TextSelectableByMouse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import TextSelectableByMouse [as 别名]
def __init__(self, myTime, lyric, myOrder, signal, parent=None):
        super(_LyricLabel, self).__init__(lyric)
        self.setObjectName('lyric')
        self.parent = parent
        self.myTime = myTime[:myTime.rfind('.')]
        self.myLyric = lyric
        self.myOrder = myOrder

        signal.connect(self.lightMe)
        
        self.setMinimumHeight(40)

        # 设置为可复制状态。
        self.setTextInteractionFlags(Qt.TextSelectableByMouse) 
开发者ID:HuberTRoy,项目名称:MusicBox,代码行数:16,代码来源:player.py

示例2: __init__

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import TextSelectableByMouse [as 别名]
def __init__(self, parent=None):
        super().__init__(parent=parent)

        self.setContentsMargins(30, 15, 30, 10)
        self.setWordWrap(True)
        self.setTextFormat(Qt.RichText)
        self.setTextInteractionFlags(Qt.TextSelectableByMouse) 
开发者ID:feeluown,项目名称:FeelUOwn,代码行数:9,代码来源:table.py

示例3: excepthook

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import TextSelectableByMouse [as 别名]
def excepthook(excType, excValue, tracebackobj):
    """Rewritten "excepthook" function, to display a message box with details about the exception.
    @param excType exception type
    @param excValue exception value
    @param tracebackobj traceback object
    """
    separator = '-' * 40
    notice = "An unhandled exception has occurred\n"

    tbinfofile = io.StringIO()
    traceback.print_tb(tracebackobj, None, tbinfofile)
    tbinfofile.seek(0)
    tbinfo = tbinfofile.read()
    errmsg = '%s: \n%s' % (str(excType), str(excValue))
    sections = [separator, errmsg, separator, tbinfo]
    msg = '\n'.join(sections)

    # Create a QMessagebox
    error_box = QMessageBox()

    error_box.setText(str(notice)+str(msg))
    error_box.setWindowTitle("Hue-plus - unhandled exception")
    error_box.setIcon(QMessageBox.Critical)
    error_box.setStandardButtons(QMessageBox.Ok)
    error_box.setTextInteractionFlags(Qt.TextSelectableByMouse)

    # Show the window
    error_box.exec_()
    sys.exit(1) 
开发者ID:kusti8,项目名称:hue-plus,代码行数:31,代码来源:hue_ui.py

示例4: get_collateral_tx_address_thread

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import TextSelectableByMouse [as 别名]
def get_collateral_tx_address_thread(self, ctrl: CtrlObject,
                                         bip44_wallet: Bip44Wallet,
                                         check_break_scanning_ext: Callable[[], bool],
                                         src_address: str):
        utxos = []
        break_scanning = False
        txes_cnt = 0
        msg = 'Scanning wallet transactions for 1000 Dash UTXOs.<br>' \
              'This may take a while (<a href="break">break</a>)....'
        ctrl.dlg_config_fun(dlg_title="Scanning wallet", show_progress_bar=False)
        ctrl.display_msg_fun(msg)

        def check_break_scanning():
            nonlocal break_scanning
            if break_scanning:
                # stop the scanning process if the dialog finishes or the address/bip32path has been found
                raise BreakFetchTransactionsException()
            if check_break_scanning_ext is not None and check_break_scanning_ext():
                raise BreakFetchTransactionsException()

        def fetch_txes_feeback(tx_cnt: int):
            nonlocal msg, txes_cnt
            txes_cnt += tx_cnt
            ctrl.display_msg_fun(msg + '<br><br>' + 'Number of transactions fetched so far: ' + str(txes_cnt))

        def on_msg_link_activated(link: str):
            nonlocal break_scanning
            if link == 'break':
                break_scanning = True

        lbl = ctrl.get_msg_label_control()
        if lbl:
            def set():
                lbl.setOpenExternalLinks(False)
                lbl.setTextInteractionFlags(lbl.textInteractionFlags() & ~Qt.TextSelectableByMouse)
                lbl.linkActivated.connect(on_msg_link_activated)
                lbl.repaint()

            WndUtils.call_in_main_thread(set)

        try:
            bip44_wallet.on_fetch_account_txs_feedback = fetch_txes_feeback
            if src_address:
                # limit transactions only to the specific address
                # addr = bip44_wallet.get_address_item(src_address, False)
                addr = bip44_wallet.scan_wallet_for_address(src_address, check_break_scanning,
                                                            feedback_fun=fetch_txes_feeback)

                if addr and addr.tree_id == bip44_wallet.get_tree_id():
                    bip44_wallet.fetch_addresses_txs([addr], check_break_scanning)
                    for utxo in bip44_wallet.list_utxos_for_addresses([addr.id], filter_by_satoshis=int(1e11)):
                        utxos.append(utxo)

            if not utxos:
                bip44_wallet.fetch_all_accounts_txs(check_break_scanning)
                for utxo in bip44_wallet.list_utxos_for_account(account_id=None, filter_by_satoshis=int(1e11)):
                    utxos.append(utxo)

        except BreakFetchTransactionsException:
            return None
        return utxos 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:63,代码来源:masternode_details.py

示例5: get_tx_address_thread

# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import TextSelectableByMouse [as 别名]
def get_tx_address_thread(ctrl: CtrlObject, addresses: List[str], bip44_wallet: Bip44Wallet) -> \
        List[Optional[Bip44AddressType]]:
    ret_addresses = []
    break_scanning = False
    txes_cnt = 0
    msg = 'Looking for a BIP32 path of the Dash address related to the masternode collateral.<br>' \
          'This may take a while (<a href="break">break</a>)....'
    ctrl.dlg_config_fun(dlg_title="Looking for address", show_progress_bar=False)
    ctrl.display_msg_fun(msg)

    def check_break_scanning():
        nonlocal break_scanning
        if break_scanning:
            # stop the scanning process if the dialog finishes or the address/bip32path has been found
            raise BreakFetchTransactionsException()

    def fetch_txes_feeback(tx_cnt: int):
        nonlocal msg, txes_cnt
        txes_cnt += tx_cnt
        ctrl.display_msg_fun(msg + '<br><br>' + 'Number of transactions fetched so far: ' + str(txes_cnt))

    def on_msg_link_activated(link: str):
        nonlocal break_scanning
        if link == 'break':
            break_scanning = True

    lbl = ctrl.get_msg_label_control()
    if lbl:
        def set():
            lbl.setOpenExternalLinks(False)
            lbl.setTextInteractionFlags(lbl.textInteractionFlags() & ~Qt.TextSelectableByMouse)
            lbl.linkActivated.connect(on_msg_link_activated)
            lbl.repaint()
        WndUtils.call_in_main_thread(set)

    # fetch the transactions that involved the addresses stored in the wallet - during this
    # all the used addresses are revealed
    for a in addresses:
        addr = bip44_wallet.scan_wallet_for_address(a, check_break_scanning, fetch_txes_feeback)
        if not addr and break_scanning:
            raise CancelException
        ret_addresses.append(addr)
    return ret_addresses 
开发者ID:Bertrand256,项目名称:dash-masternode-tool,代码行数:45,代码来源:bip44_wallet.py


注:本文中的PyQt5.QtCore.Qt.TextSelectableByMouse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。