本文整理汇总了Python中PyQt5.QtCore.Qt.MatchExactly方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.MatchExactly方法的具体用法?Python Qt.MatchExactly怎么用?Python Qt.MatchExactly使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.MatchExactly方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_item
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def get_item(self, path: List[str], item_name: str):
parents = [None]
for i, name in enumerate(path + [item_name]):
parent_model = self if i == 0 else parents[-1]
items = self.findItems(name, Qt.MatchExactly | Qt.MatchRecursive)
target_item = None
if not items: # create new item if it does not exist
target_item = self._create_item(parent_model, name, {Qt.UserRole: "", Qt.UserRole+1: ""})
else:
for item in items: # check found items with corresponding parent
if item.parent() == parents[-1]:
target_item = item
if target_item is None:
target_item = self._create_item(parent_model, name, {Qt.UserRole: "", Qt.UserRole + 1: ""})
parents.append(target_item)
return parents[-1]
示例2: set_listview_item_bgcolor
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def set_listview_item_bgcolor(self, item_text, qcolor_rgb):
"""Changes the background color of a list view item based on it's
case-sensitive name. There should only ever be one, however if there
is a duplicate it will be changed as well.
:param item_text: The name of the item to look for.
:param qcolor_rgb: An instance of QColor -
http://doc.qt.nokia.com/4.7-snapshot/qcolor.html
:returns: void
@author: scmcleni
"""
brush = QtGui.QBrush(qcolor_rgb)
brush.setStyle(QtCore.Qt.SolidPattern)
items = self.rule_list_widget.findItems(item_text, QtCore.Qt.MatchExactly)
for item in items:
item.setBackground(brush)
示例3: set_listview_item_icon
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def set_listview_item_icon(self, item_text, iconame):
"""Updates the icon associated with an entry in the list view.
The icon name (iconame) is a enum indicating one of the four possible
icon types: grn, red, warn, quest. The item_text should be the rule
name.
:param string item_text: (rule name)
:param string iconame: (grn, red, warn, quest)
@author: David Kennel
"""
myicon = os.path.join(self.icon_path, self.questionmark)
if iconame == 'grn':
myicon = os.path.join(self.icon_path, self.compliant)
elif iconame == 'red':
myicon = os.path.join(self.icon_path, self.notcompliant)
elif iconame == 'warn':
myicon = os.path.join(self.icon_path, self.warning)
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(myicon), QtGui.QIcon.Normal, QtGui.QIcon.Off)
items = self.rule_list_widget.findItems(item_text, QtCore.Qt.MatchExactly)
for item in items:
item.setIcon(icon)
示例4: remove_find
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def remove_find(self, addr):
model = self.ui.findView.model()
for item in self.ui.findView.findItems("0x%x" % addr, Qt.MatchExactly):
i = self.ui.findView.indexFromItem(item)
model.removeRow(i.row())
示例5: remove_avoid
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def remove_avoid(self, addr):
model = self.ui.avoidView.model()
for item in self.ui.avoidView.findItems("0x%x" % addr, Qt.MatchExactly):
i = self.ui.avoidView.indexFromItem(item)
model.removeRow(i.row())
示例6: sold
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def sold(self, tick):
results = self.findItems(tick.T, Qt.MatchExactly)
if results:
for row in results:
_row = row.row()
if not self.item(_row, 3).text():
tItem = QTableWidgetItem(str(tick.C))
tItem.setTextAlignment(Qt.AlignCenter)
self.setItem(_row, 3, tItem)
for j in range(self.columnCount()):
if tick.prevProfit > 0:
self.item(_row, j).setBackground(color('G'))
elif tick.prevProfit < 0:
self.item(_row, j).setBackground(color('R'))
else:
self.item(_row, j).setBackground(color('NA'))
else:
_row = self.rowCount()
self.insertRow(_row)
data = [tick.T, tick.Q, tick.AP, tick.C]
for item in range(len(data)):
tItem = QTableWidgetItem(str(data[item]))
tItem.setTextAlignment(Qt.AlignCenter)
self.setItem(_row, item, tItem)
for j in range(self.columnCount()):
if tick.C > tick.AP:
self.item(_row, j).setBackground(color('G'))
elif tick.AP < tick.C:
self.item(_row, j).setBackground(color('R'))
else:
self.item(_row, j).setBackground(color('NA'))
示例7: collapse
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def collapse(self, text):
items = self.findItems(text, Qt.MatchExactly)
for item in items:
self.collapseItem(item)
示例8: get_attr_value
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def get_attr_value(self, text):
idxlist = self.client.attrs_ui.model.match(self.client.attrs_ui.model.index(0, 0), Qt.DisplayRole, text, 1, Qt.MatchExactly | Qt.MatchRecursive)
idx = idxlist[0]
idx = idx.sibling(idx.row(), 1)
item = self.client.attrs_ui.model.itemFromIndex(idx)
return item.data(Qt.UserRole).value
示例9: add_to_AS
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def add_to_AS(self, *objects):
self.AS.add_to_AS(*objects)
for obj in objects:
if self.dict_listbox[obj.class_type].findItems(str(obj), Qt.MatchExactly):
continue
self.dict_listbox[obj.class_type].addItem(str(obj))
示例10: remove_from_AS
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def remove_from_AS(self, *objects):
self.AS.remove_from_AS(*objects)
for obj in objects:
item ,= self.dict_listbox[obj.class_type].findItems(str(obj), Qt.MatchExactly)
row = self.dict_listbox[obj.class_type].row(item)
self.dict_listbox[obj.class_type].takeItem(row)
示例11: setText
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def setText(self, text):
index = self.findText(text, Qt.MatchExactly)
self.setCurrentIndex(index)
示例12: _on_hit_module_initialization_breakpoint
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def _on_hit_module_initialization_breakpoint(self, data):
items = self._breakpoints_model.findItems(data[1]['module'], Qt.MatchExactly, 2)
if len(items) > 0:
self._breakpoints_model.item(items[0].row(), 0).setText(data[1]['moduleBase'])
示例13: _on_hit_java_class_initialization_breakpoint
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def _on_hit_java_class_initialization_breakpoint(self, data):
items = self._breakpoints_model.findItems(data[0], Qt.MatchExactly, 2)
if len(items) > 0:
pass
示例14: _create_bookmark
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def _create_bookmark(self, index=-1, ptr='', note=''):
if ptr == '':
if isinstance(index, int) and index >= 0:
ptr = self._bookmarks_model.item(index, 0).text()
note = self._bookmarks_model.item(index, 1).text()
ptr, _ = InputDialog.input_pointer(
parent=self._app_window, input_content=ptr)
else:
ptr = utils.parse_ptr(ptr)
if ptr > 0:
ptr = hex(ptr)
if self._bookmarks_list.uppercase_hex:
ptr = ptr.upper().replace('0X', '0x')
index = self._bookmarks_model.findItems(ptr, Qt.MatchExactly)
if len(index) > 0:
index = index[0].row()
note = self._bookmarks_model.item(index, 1).text()
else:
index = -1
accept = note != ''
if note == '':
accept, note = InputDialog.input(
hint='Insert notes for %s' % ptr, input_content=note)
if accept:
if index < 0:
self.insert_bookmark(ptr, note)
else:
item = self._bookmarks_model.item(index, 0)
item.setText(ptr)
item = self._bookmarks_model.item(index, 1)
item.setText(note)
self.bookmarks[ptr] = note
示例15: add_timer
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import MatchExactly [as 别名]
def add_timer(self):
t = self.timerEdit.text()
ti = t.replace(':', '')
if not self.timerListWidget.findItems(ti, Qt.MatchExactly):
self.timerListWidget.addItem(ti)
else:
MyMessageBox.warning(self, "提示", "已存在该时间!请重新提交!", QMessageBox.Ok)