本文整理汇总了Python中PyQt4.QtCore.Qt.red方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.red方法的具体用法?Python Qt.red怎么用?Python Qt.red使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.red方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pushButtonAutoCheckClicked
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import red [as 别名]
def pushButtonAutoCheckClicked(self):
root = self.treeWidget.invisibleRootItem()
success = 0
fail = 0
for i in range(root.childCount()):
item = root.child(i)
exploit = self.__exploits[str(item.text(0))]
if exploit.check():
exploit.vulnerable = True
w = self.__stackedWidgetController.getWidgetWithExploit(exploit)
w.setCheckBoxVulnerableChecked(True)
self.addExploitSuccess(exploit)
success += 1
item.setForeground(0, QBrush(QColor(Qt.green)))
else:
fail += 1
item.setForeground(0, QBrush(QColor(Qt.red)))
self.labelCheck.setText("Result: {0} OK - {1} Fail".format(success, fail))
示例2: data
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import red [as 别名]
def data(self, modelIndex, role=None):
if not modelIndex.isValid():
return None
row = modelIndex.row()
col = modelIndex.column()
if role == Qt.DisplayRole:
if col in [PlayerModel.PLAYER, PlayerModel.PING, PlayerModel.OPPONENT]:
return self.players[row][col]
elif role == Qt.ToolTipRole and col in [PlayerModel.PLAYER, PlayerModel.OPPONENT]:
name = self.players[row][col]
if name in self.controller.players:
if self.controller.players[name].city:
return self.controller.players[name].country + ', ' + self.controller.players[name].city
else:
return self.controller.players[name].country
elif role == Qt.CheckStateRole and col == PlayerModel.IGNORE:
return self.players[row][col]
elif role == Qt.DecorationRole:
return self.dataIcon(row, col)
elif role == Qt.TextAlignmentRole:
if col == PlayerModel.PING:
return Qt.AlignRight | Qt.AlignVCenter
elif role == Qt.TextColorRole:
if col in [PlayerModel.PLAYER, PlayerModel.OPPONENT]:
name = self.players[row][col]
if name == 'ponder':
return QtGui.QBrush(QtGui.QColor(Qt.red))
示例3: open_color_pick_dialog1
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import red [as 别名]
def open_color_pick_dialog1(self):
color = QColorDialog.getColor(self.extruder1_color)
if color.isValid():
self.extruder1_color = color
self.extruder1_cb.setStyleSheet("background-color: rgb(%s, %s, %s)" % (color.red(), color.green(), color.blue()))
self.update_object_extruders_cb()
示例4: open_color_pick_dialog2
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import red [as 别名]
def open_color_pick_dialog2(self):
color = QColorDialog.getColor(self.extruder2_color)
if color.isValid():
self.extruder2_color = color
self.extruder2_cb.setStyleSheet("background-color: rgb(%s, %s, %s)" % (color.red(), color.green(), color.blue()))
self.update_object_extruders_cb()
示例5: open_color_pick_dialog3
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import red [as 别名]
def open_color_pick_dialog3(self):
color = QColorDialog.getColor(self.extruder3_color)
if color.isValid():
self.extruder3_color = color
self.extruder3_cb.setStyleSheet("background-color: rgb(%s, %s, %s)" % (color.red(), color.green(), color.blue()))
self.update_object_extruders_cb()
示例6: open_color_pick_dialog4
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import red [as 别名]
def open_color_pick_dialog4(self):
color = QColorDialog.getColor(self.extruder4_color)
if color.isValid():
self.extruder4_color = color
self.extruder4_cb.setStyleSheet("background-color: rgb(%s, %s, %s)" % (color.red(), color.green(), color.blue()))
self.update_object_extruders_cb()
示例7: __init__
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import red [as 别名]
def __init__(self, canvas):
self.canvas = canvas
QgsMapToolEmitPoint.__init__(self, self.canvas)
self.rubberband = QgsRubberBand(self.canvas, QGis.Polygon)
self.rubberband.setColor(Qt.red)
self.rubberband.setWidth(1)
self.point = None
self.points = []
开发者ID:PacktPublishing,项目名称:QGIS-Python-Programming-Cookbook-Second-Edition,代码行数:10,代码来源:B06246_05_30-poly.py
示例8: __init__
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import red [as 别名]
def __init__(self, vectorLayer, parent=None, symbol_layer=None):
QgsSimpleMarkerSymbolLayerV2Widget.__init__(self, vectorLayer, parent)
#Set symbol layer for the widget
self._sym_layer = symbol_layer
if self._sym_layer is None:
self._sym_layer = QgsSimpleMarkerSymbolLayerV2()
self._sym_layer.setBorderColor(Qt.red)
self._sym_layer.setFillColor(Qt.yellow)
self.setSymbolLayer(self._sym_layer)
self.remove_data_defined_properties_button()
示例9: paintEvent
# 需要导入模块: from PyQt4.QtCore import Qt [as 别名]
# 或者: from PyQt4.QtCore.Qt import red [as 别名]
def paintEvent(self, event):
path = QPainterPath()
start_y = self.label_height
#path.moveTo(85, self.label_height)
#path.moveTo(85, 400-self.label_height)
#defined_points = [p for p in self.points if not p['value'] == -1]
#if len(defined_points)>2:
for i, p in enumerate(self.data):
y = (350./ (self.number_of_ticks)) * i + start_y
if i == 0:
path.moveTo((p * 20.) + 85, y)
else:
path.lineTo((p * 20.) + 85, y)
#path.cubicTo((defined_points[0]['detail'] * 10.) + 85, self.label_height,
# (defined_points[1]['detail'] * 10.) + 85, 200,
# (defined_points[2]['detail'] * 10.) + 85, 400-self.label_height)
#else:
#print("Count of height for point: " + str((((self.max-self.min)/self.number_of_ticks) * defined_points[0]['value'])))
# path.lineTo((defined_points[0]['detail']*10.)+85, self.label_height)
# path.lineTo((defined_points[1]['detail']*10.)+85, 350+self.label_height)
#path.lineTo(100, 100)
#path.lineTo(150, 150)
#path.cubicTo(50, 50, 50, 50, 80, 80)
#path.cubicTo(80, 80, 50, 50, 80, 80)
pen01 = QPen(Qt.white)
pen01.setWidthF(2.0)
pen02 = QPen(Qt.green)
pen03 = QPen(Qt.red)
pen02.setWidthF(2.5)
qp = QPainter()
qp.begin(self)
qp.setRenderHint(QPainter.Antialiasing)
#grid
qp.setPen(pen01)
qp.drawLine(20, self.label_height, 160, self.label_height)
qp.drawLine(20, self.label_height + 350, 160, 350 + self.label_height)
qp.drawLine(20, self.label_height, 20, 350 + self.label_height)
qp.drawLine(160, self.label_height, 160, 350 + self.label_height)
#path
qp.setPen(pen02)
qp.drawPath(path)
qp.end()