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


Python QLineEdit.setMouseTracking方法代碼示例

本文整理匯總了Python中PyQt5.QtWidgets.QLineEdit.setMouseTracking方法的典型用法代碼示例。如果您正苦於以下問題:Python QLineEdit.setMouseTracking方法的具體用法?Python QLineEdit.setMouseTracking怎麽用?Python QLineEdit.setMouseTracking使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyQt5.QtWidgets.QLineEdit的用法示例。


在下文中一共展示了QLineEdit.setMouseTracking方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: EditView

# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import setMouseTracking [as 別名]

#.........這裏部分代碼省略.........
        HBL.addWidget(FolioLabel)

        self.Folio = QLabel(bot_frame)
        sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(False)
        self.Folio.setSizePolicy(sizePolicy)
        self.Folio.setMinimumSize(QSize(30, 12))
        self.Folio.setContextMenuPolicy(Qt.NoContextMenu)
        self.Folio.setFrameShape(QFrame.StyledPanel)
        self.Folio.setAlignment( Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter )
        self.Folio.setObjectName("Folio display")
        self.Folio.setToolTip(_TR("EditViewWidget", "Folio value for current page", "tooltip"))
        self.Folio.setStatusTip(_TR("EditViewWidget", "Folio value for the page under the edit cursor", "statustip"))
        self.Folio.setWhatsThis(_TR("EditViewWidget", "The Folio (page number) value for the page under the edit cursor. Use the Pages panel to adjust folios to agree with the printed book.","whats this"))
        HBL.addWidget(self.Folio)
        spacerItem = QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Minimum)
        HBL.addItem(spacerItem)
        FolioLabel.setBuddy(self.Folio)

        # Set up the image filename lineedit and its buddy label.
        ImageFilenameLabel = QLabel(bot_frame)
        ImageFilenameLabel.setAlignment( Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter )
        ImageFilenameLabel.setText(_TR("EditViewWidget", "Image", "Image field label"))
        HBL.addWidget(ImageFilenameLabel)
        self.ImageFilename = QLineEdit(bot_frame)
        sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Fixed )
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(False)
        self.ImageFilename.setSizePolicy(sizePolicy)
        self.ImageFilename.setMinimumSize(QSize(30, 12))
        self.ImageFilename.setMouseTracking(False)
        self.ImageFilename.setFocusPolicy(Qt.ClickFocus)
        self.ImageFilename.setContextMenuPolicy(Qt.NoContextMenu)
        self.ImageFilename.setAcceptDrops(True)
        self.ImageFilename.setInputMask("")
        self.ImageFilename.setAlignment( Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter )
        self.ImageFilename.setObjectName("ImageFilename")
        self.ImageFilename.setToolTip(_TR("EditViewWidget", "Scan image filename", "Image tooltip"))
        self.ImageFilename.setStatusTip(_TR("EditViewWidget", "Filename of the scan image under the edit cursor", "Image status tip"))
        self.ImageFilename.setWhatsThis(_TR("EditViewWidget", "This is the name of the scanned image that produced the text under the edit cursor. This image file is displayed in the Image panel.","Image whats this"))
        HBL.addWidget(self.ImageFilename)
        spacerItem =  QSpacerItem(0, 0,  QSizePolicy.Expanding,  QSizePolicy.Minimum)
        HBL.addItem(spacerItem)
        ImageFilenameLabel.setBuddy(self.ImageFilename)

        # Set up the line number lineedit and its buddy label.
        LineNumberLabel = QLabel(bot_frame)
        LineNumberLabel.setText(_TR("EditViewWidget", "Line#", "Line number label"))
        LineNumberLabel.setAlignment( Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter )
        HBL.addWidget(LineNumberLabel)
        self.LineNumber = QLineEdit(bot_frame)
        sizePolicy = QSizePolicy( QSizePolicy.Expanding,  QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(False)
        self.LineNumber.setSizePolicy(sizePolicy)
        self.LineNumber.setMinimumSize(QSize(0, 12))
        self.LineNumber.setMouseTracking(False)
        self.LineNumber.setFocusPolicy(Qt.ClickFocus)
        self.LineNumber.setContextMenuPolicy(Qt.NoContextMenu)
        self.LineNumber.setAcceptDrops(True)
        self.LineNumber.setLayoutDirection(Qt.LeftToRight)
        self.LineNumber.setCursorPosition(0)
開發者ID:B-Rich,項目名稱:PPQT2,代碼行數:70,代碼來源:editview.py

示例2: EditView

# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import setMouseTracking [as 別名]

#.........這裏部分代碼省略.........
        HBL.addWidget(FolioLabel)

        self.Folio = QLabel(bot_frame)
        sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(False)
        self.Folio.setSizePolicy(sizePolicy)
        self.Folio.setMinimumSize(QSize(30, 12))
        self.Folio.setContextMenuPolicy(Qt.NoContextMenu)
        self.Folio.setFrameShape(QFrame.StyledPanel)
        self.Folio.setAlignment( Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter )
        self.Folio.setObjectName("Folio display")
        self.Folio.setToolTip(_TR("EditViewWidget", "Folio value for current page", "tooltip"))
        self.Folio.setStatusTip(_TR("EditViewWidget", "Folio value for the page under the edit cursor", "statustip"))
        self.Folio.setWhatsThis(_TR("EditViewWidget", "The Folio (page number) value for the page under the edit cursor. Use the Pages panel to adjust folios to agree with the printed book.","whats this"))
        HBL.addWidget(self.Folio)
        spacerItem = QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Minimum)
        HBL.addItem(spacerItem)
        FolioLabel.setBuddy(self.Folio)

        # Set up the image filename lineedit and its buddy label.
        ImageFilenameLabel = QLabel(bot_frame)
        ImageFilenameLabel.setAlignment( Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter )
        ImageFilenameLabel.setText(_TR("EditViewWidget", "Image", "Image field label"))
        HBL.addWidget(ImageFilenameLabel)
        self.ImageFilename = QLineEdit(bot_frame)
        sizePolicy = QSizePolicy( QSizePolicy.Expanding, QSizePolicy.Fixed )
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(False)
        self.ImageFilename.setSizePolicy(sizePolicy)
        self.ImageFilename.setMinimumSize(QSize(30, 12))
        self.ImageFilename.setMouseTracking(False)
        self.ImageFilename.setFocusPolicy(Qt.ClickFocus)
        self.ImageFilename.setContextMenuPolicy(Qt.NoContextMenu)
        self.ImageFilename.setAcceptDrops(True)
        self.ImageFilename.setInputMask("")
        self.ImageFilename.setAlignment( Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter )
        self.ImageFilename.setObjectName("ImageFilename")
        self.ImageFilename.setToolTip(_TR("EditViewWidget", "Scan image filename", "Image tooltip"))
        self.ImageFilename.setStatusTip(_TR("EditViewWidget", "Filename of the scan image under the edit cursor", "Image status tip"))
        self.ImageFilename.setWhatsThis(_TR("EditViewWidget", "This is the name of the scanned image that produced the text under the edit cursor. This image file is displayed in the Image panel.","Image whats this"))
        HBL.addWidget(self.ImageFilename)
        spacerItem =  QSpacerItem(0, 0,  QSizePolicy.Expanding,  QSizePolicy.Minimum)
        HBL.addItem(spacerItem)
        ImageFilenameLabel.setBuddy(self.ImageFilename)

        # Set up the line number lineedit and its buddy label.
        LineNumberLabel = QLabel(bot_frame)
        LineNumberLabel.setText(_TR("EditViewWidget", "Line#", "Line number label"))
        LineNumberLabel.setAlignment( Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter )
        HBL.addWidget(LineNumberLabel)
        self.LineNumber = QLineEdit(bot_frame)
        sizePolicy = QSizePolicy( QSizePolicy.Expanding,  QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(False)
        self.LineNumber.setSizePolicy(sizePolicy)
        self.LineNumber.setMinimumSize(QSize(0, 12))
        self.LineNumber.setMouseTracking(False)
        self.LineNumber.setFocusPolicy(Qt.ClickFocus)
        self.LineNumber.setContextMenuPolicy(Qt.NoContextMenu)
        self.LineNumber.setAcceptDrops(True)
        self.LineNumber.setLayoutDirection(Qt.LeftToRight)
        self.LineNumber.setCursorPosition(0)
開發者ID:tallforasmurf,項目名稱:PPQT2,代碼行數:70,代碼來源:editview.py


注:本文中的PyQt5.QtWidgets.QLineEdit.setMouseTracking方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。