本文整理汇总了Python中AnyQt.QtWidgets.QLineEdit.hide方法的典型用法代码示例。如果您正苦于以下问题:Python QLineEdit.hide方法的具体用法?Python QLineEdit.hide怎么用?Python QLineEdit.hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtWidgets.QLineEdit
的用法示例。
在下文中一共展示了QLineEdit.hide方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ComboBoxSearch
# 需要导入模块: from AnyQt.QtWidgets import QLineEdit [as 别名]
# 或者: from AnyQt.QtWidgets.QLineEdit import hide [as 别名]
#.........这里部分代码省略.........
window.ensurePolished()
if window.layout() is not None:
window.layout().activate()
else:
QApplication.sendEvent(window, QEvent(QEvent.LayoutRequest))
margins = qwidget_margin_within(popup.viewport(), window)
height = (listrect.height() + 2 * popup.spacing() +
margins.top() + margins.bottom())
popup_size = (QSize(popuprect_origin.width(), height)
.expandedTo(window.minimumSize())
.boundedTo(window.maximumSize())
.boundedTo(screenrect.size()))
popuprect = QRect(popuprect_origin.bottomLeft(), popup_size)
popuprect = dropdown_popup_geometry(
popuprect, popuprect_origin, screenrect)
popup.setGeometry(popuprect)
current = proxy.mapFromSource(
self.model().index(self.currentIndex(), self.modelColumn(),
self.rootModelIndex()))
popup.setCurrentIndex(current)
popup.scrollTo(current, QAbstractItemView.EnsureVisible)
popup.show()
popup.setFocus(Qt.PopupFocusReason)
popup.installEventFilter(self)
popup.viewport().installEventFilter(self)
popup.viewport().setMouseTracking(True)
self.update()
self.__popupTimer.restart()
def hidePopup(self):
"""Reimplemented"""
if self.__popup is not None:
popup = self.__popup
self.__popup = self.__proxy = None
popup.setFocusProxy(None)
popup.hide()
popup.deleteLater()
popup.removeEventFilter(self)
popup.viewport().removeEventFilter(self)
# need to call base hidePopup even though the base showPopup was not
# called (update internal state wrt. 'pressed' arrow, ...)
super().hidePopup()
self.__searchline.hide()
self.update()
def initStyleOption(self, option):
# type: (QStyleOptionComboBox) -> None
super().initStyleOption(option)
option.editable = True
def __updateGeometries(self):
opt = QStyleOptionComboBox()
self.initStyleOption(opt)
editarea = self.style().subControlRect(
QStyle.CC_ComboBox, opt, QStyle.SC_ComboBoxEditField, self)
self.__searchline.setGeometry(editarea)
def resizeEvent(self, event):
"""Reimplemented."""
super().resizeEvent(event)
self.__updateGeometries()