Obsolete Members for QColor

以下成員源於類 QColor 被棄用。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

公共函數

(deprecated (6.6)) void setNamedColor (const QString & name )
(deprecated (6.6)) void setNamedColor (QStringView name )
(deprecated (6.6)) void setNamedColor (QLatin1StringView name )

靜態公共成員

(deprecated (6.6)) bool isValidColor (const QString & name )
(deprecated (6.6)) bool isValidColor (QStringView name )
(deprecated (6.6)) bool isValidColor (QLatin1StringView name )

成員函數文檔編製

[static] bool QColor:: isValidColor (const QString & name )

This function is deprecated since 6.6. We strongly advise against using it in new code.

使用 isValidColorName () 代替。

返迴 true name is a valid color name and can be used to construct a valid QColor 對象,否則返迴 false。

It uses the same algorithm used in setNamedColor ().

另請參閱 setNamedColor ().

[static] bool QColor:: isValidColor ( QStringView name )

This function is deprecated since 6.6. We strongly advise against using it in new code.

這是重載函數。

使用 isValidColorName () 代替。

[static] bool QColor:: isValidColor ( QLatin1StringView name )

This function is deprecated since 6.6. We strongly advise against using it in new code.

這是重載函數。

使用 isValidColorName () 代替。

void QColor:: setNamedColor (const QString & name )

This function is deprecated since 6.6. We strongly advise against using it in new code.

使用 fromString () 代替。

設置 RGB 值為此 QColor to name ,可能是這些格式之一:

  • #RGB (R、G 和 B 中的每個都是單一十六進製數字)
  • #RRGGBB
  • #AARRGGBB (從 5.2 起)
  • #RRRGGGBBB
  • #RRRRGGGGBBBB
  • 來自列錶的顔色名稱的定義在列錶 SVG 顔色關鍵詞名稱 提供通過 WWW (萬維網) 聯盟;例如,steelblue (鋼藍色) 或 gainsboro (亮灰色)。這些顔色名稱工作於所有平颱。注意,這些顔色名稱 not 一樣如定義通過 Qt::GlobalColor 枚舉,如 green (綠色) 和 Qt::green 不是指同一顔色。
  • transparent - 錶示缺乏顔色。

顔色無效若 name 無法剖析。

另請參閱 QColor (), name (),和 isValid ().

void QColor:: setNamedColor ( QStringView name )

This function is deprecated since 6.6. We strongly advise against using it in new code.

這是重載函數。

使用 fromString () 代替。

void QColor:: setNamedColor ( QLatin1StringView name )

This function is deprecated since 6.6. We strongly advise against using it in new code.

這是重載函數。

使用 fromString () 代替。