pyqt4文档阅读(8):QComboBox

本文详细介绍了PyQt4中的QComboBox组件,包括其属性、方法、Qt信号、编辑功能、选项操作、插入策略、自动补全、内容匹配和下拉菜单管理等。QComboBox结合了下拉菜单和可编辑文本框,提供了丰富的交互功能。
摘要由CSDN通过智能技术生成

本系列文章长期更新修改.


QComboBox,中文翻译是组合框?就是一个提供下拉菜单的选值框.



属性:


Types

  • enum InsertPolicy { NoInsert, InsertAtTop, InsertAtCurrent, InsertAtBottom, ..., InsertAlphabetically }
  • enum SizeAdjustPolicy { AdjustToContents, AdjustToContentsOnFirstShow, AdjustToMinimumContentsLength, AdjustToMinimumContentsLengthWithIcon }

Methods

  • __init__ (self, QWidget parent = None)
  • addItem (self, QString atext, QVariant auserData = QVariant())
  • addItem (self, QIcon aicon, QString atext, QVariant auserData = QVariant())
  • addItems (self, QStringList texts)
  • bool autoCompletion (self)
  • Qt.CaseSensitivity autoCompletionCaseSensitivity (self)
  • changeEvent (self, QEvent e)
  • clear (self)
  • clearEditText (self)
  • QCompleter completer (self)
  • contextMenuEvent (self, QContextMenuEvent e)
  • int count (self)
  • int currentIndex (self)
  • QString currentText (self)
  • bool duplicatesEnabled (self)
  • bool event (self, QEvent event)
  • int findData (self, QVariant data, int role = Qt.UserRole, Qt.MatchFlags flags = Qt.MatchExactly | Qt.MatchCaseSensitive)
  • int findText (self, QString text, Qt.MatchFlags flags = Qt.MatchExactly | Qt.MatchCaseSensitive)
  • focusInEvent (self, QFocusEvent e)
  • focusOutEvent (self, QFocusEvent e)
  • bool hasFrame (self)
  • hideEvent (self, QHideEvent e)
  • hidePopup (self)
  • QSize iconSize (self)
  • initStyleOption (self, QStyleOptionComboBox option)
  • inputMethodEvent (self, QInputMethodEvent)
  • QVariant inputMethodQuery (self, Qt.InputMethodQuery)
  • insertItem (self, int aindex, QString atext, QVariant auserData = QVariant())
  • insertItem (self, int index, QIcon icon, QString text, QVariant userData = QVariant())
  • insertItems (self, int index, QStringList texts)
  • InsertPolicy insertPolicy (self)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值