本文整理汇总了Python中PySide.QtGui.QColor.colorNames方法的典型用法代码示例。如果您正苦于以下问题:Python QColor.colorNames方法的具体用法?Python QColor.colorNames怎么用?Python QColor.colorNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtGui.QColor
的用法示例。
在下文中一共展示了QColor.colorNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: form
# 需要导入模块: from PySide.QtGui import QColor [as 别名]
# 或者: from PySide.QtGui.QColor import colorNames [as 别名]
convert_to_color.info = ('a string of the form (r,g,b) or (r,g,b,a) where r, '
'g, b, and a are integers from 0 to 255, a QColor '
'instance, a Qt.GlobalColor, an integer which in hex '
'is of the form 0xRRGGBB, a string of the form #RGB, '
'#RRGGBB, #RRRGGGBBB or #RRRRGGGGBBBB')
#-------------------------------------------------------------------------------
# Standard colors:
#-------------------------------------------------------------------------------
# Note that this is slightly different from the wx implementation in that the
# names do not include spaces and the full set of SVG color keywords is
# supported.
standard_colors = {}
for name in QColor.colorNames():
standard_colors[ str( name ) ] = QColor( name )
#-------------------------------------------------------------------------------
# Define Qt specific color facets:
#-------------------------------------------------------------------------------
ColorFacets = ( Facet( 'white', standard_colors, convert_to_color,
editor = ColorEditor ),
Facet( 'white', None, standard_colors, convert_to_color,
editor = ColorEditor ) )
def QtColor ( default = 'white', allow_none = False, **metadata ):
""" Defines Qt-specific color facets.
"""
return ColorFacets[ allow_none is True ]( default, **metadata )