本文整理匯總了Python中PyQt5.QtWidgets.QLineEdit.setStatusTip方法的典型用法代碼示例。如果您正苦於以下問題:Python QLineEdit.setStatusTip方法的具體用法?Python QLineEdit.setStatusTip怎麽用?Python QLineEdit.setStatusTip使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt5.QtWidgets.QLineEdit
的用法示例。
在下文中一共展示了QLineEdit.setStatusTip方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: EditView
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import setStatusTip [as 別名]
#.........這裏部分代碼省略.........
self.Editor.setTextCursor(tc)
# Make a valid cursor based on position and anchor values possibly
# input by the user.
def make_cursor(self, position, anchor):
mx = self.document.characterCount()
tc = QTextCursor(self.Editor.textCursor())
anchor = min( max(0,anchor), mx )
position = min ( max(0,position), mx )
tc.setPosition(anchor)
tc.setPosition(position,QTextCursor.KeepAnchor)
return tc
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# INITIALIZE UI
#
# First we built the Edit panel using Qt Creator which produced a large
# and somewhat opaque block of code that had to be mixed in by
# multiple inheritance. This had several drawbacks, so the following
# is a "manual" UI setup using code drawn from the generated code.
#
def _uic(self):
# First set up the properties of "self", a QWidget.
self.setObjectName("EditViewWidget")
sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(False) # don't care to bind height to width
self.setSizePolicy(sizePolicy)
self.setMinimumSize(QSize(250, 250))
self.setFocusPolicy(Qt.StrongFocus)
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.setWindowTitle("")
self.setToolTip("")
self.setStatusTip("")
self.setWhatsThis("")
# Set up our primary widget, the editor
self.Editor = PTEditor(self,self.my_book)
self.Editor.setObjectName("Editor")
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(2) # Edit deserves all available space
sizePolicy.setVerticalStretch(2)
sizePolicy.setHeightForWidth(False)
self.Editor.setSizePolicy(sizePolicy)
self.Editor.setFocusPolicy(Qt.StrongFocus)
self.Editor.setContextMenuPolicy(Qt.NoContextMenu)
self.Editor.setAcceptDrops(True)
self.Editor.setLineWidth(2)
self.Editor.setDocumentTitle("")
self.Editor.setLineWrapMode(QPlainTextEdit.NoWrap)
# Set up the frame that will contain the bottom row of widgets
# It doesn't need a parent and doesn't need to be a class member
# because it will be added to a layout, which parents it.
bot_frame = QFrame()
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(False)
bot_frame.setSizePolicy(sizePolicy)
bot_frame.setMinimumSize(QSize(0, 24))
bot_frame.setContextMenuPolicy(Qt.NoContextMenu)
bot_frame.setFrameShape(QFrame.Panel)
bot_frame.setFrameShadow(QFrame.Sunken)
bot_frame.setLineWidth(3)
# Set up the horizontal layout that will contain the following
示例2: EditView
# 需要導入模塊: from PyQt5.QtWidgets import QLineEdit [as 別名]
# 或者: from PyQt5.QtWidgets.QLineEdit import setStatusTip [as 別名]
#.........這裏部分代碼省略.........
self.Editor.setTextCursor(tc)
# Make a valid cursor based on position and anchor values possibly
# input by the user.
def make_cursor(self, position, anchor):
mx = self.document.characterCount()
tc = QTextCursor(self.Editor.textCursor())
anchor = min( max(0,anchor), mx )
position = min ( max(0,position), mx )
tc.setPosition(anchor)
tc.setPosition(position,QTextCursor.KeepAnchor)
return tc
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
# INITIALIZE UI
#
# First we built the Edit panel using Qt Creator which produced a large
# and somewhat opaque block of code that had to be mixed in by
# multiple inheritance. This had several drawbacks, so the following
# is a "manual" UI setup using code drawn from the generated code.
#
def _uic(self):
# First set up the properties of "self", a QWidget.
self.setObjectName("EditViewWidget")
sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding)
sizePolicy.setHorizontalStretch(1)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(False) # don't care to bind height to width
self.setSizePolicy(sizePolicy)
self.setMinimumSize(QSize(250, 250))
self.setFocusPolicy(Qt.StrongFocus)
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.setWindowTitle("")
self.setToolTip("")
self.setStatusTip("")
self.setWhatsThis("")
# Set up our primary widget, the editor
self.Editor = PTEditor(self,self.my_book)
self.Editor.setObjectName("Editor")
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(2) # Edit deserves all available space
sizePolicy.setVerticalStretch(2)
sizePolicy.setHeightForWidth(False)
self.Editor.setSizePolicy(sizePolicy)
self.Editor.setFocusPolicy(Qt.StrongFocus)
self.Editor.setContextMenuPolicy(Qt.NoContextMenu)
self.Editor.setAcceptDrops(True)
self.Editor.setLineWidth(2)
self.Editor.setDocumentTitle("")
self.Editor.setLineWrapMode(QPlainTextEdit.NoWrap)
# Set up the frame that will contain the bottom row of widgets
# It doesn't need a parent and doesn't need to be a class member
# because it will be added to a layout, which parents it.
bot_frame = QFrame()
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(False)
bot_frame.setSizePolicy(sizePolicy)
bot_frame.setMinimumSize(QSize(0, 24))
bot_frame.setContextMenuPolicy(Qt.NoContextMenu)
bot_frame.setFrameShape(QFrame.Panel)
bot_frame.setFrameShadow(QFrame.Sunken)
bot_frame.setLineWidth(3)
# Set up the horizontal layout that will contain the following