diff --git a/qttypes/src/gui/mod.rs b/qttypes/src/gui/mod.rs index ab7fe354..a7922ae2 100644 --- a/qttypes/src/gui/mod.rs +++ b/qttypes/src/gui/mod.rs @@ -1,2 +1,2 @@ mod qcolor; -pub use self::qcolor::{NameFormat, QColor, QRgb, QRgba64, Spec}; +pub use self::qcolor::{QColor, QColorNameFormat, QColorSpec, QRgb, QRgba64}; diff --git a/qttypes/src/gui/qcolor.rs b/qttypes/src/gui/qcolor.rs index a45cfbf4..443abb52 100644 --- a/qttypes/src/gui/qcolor.rs +++ b/qttypes/src/gui/qcolor.rs @@ -73,10 +73,10 @@ impl Into for QRgba64 { #[repr(u32)] #[derive(Clone, Copy, PartialEq, Debug)] #[allow(non_camel_case_types)] -pub enum NameFormat { - // #RRGGBB A "#" character followed by three two-digit hexadecimal numbers (i.e. #RRGGBB). +pub enum QColorNameFormat { + /// #RRGGBB A "#" character followed by three two-digit hexadecimal numbers (i.e. #RRGGBB). HexRgb = 0, - //#AARRGGBB A "#" character followed by four two-digit hexadecimal numbers (i.e. #AARRGGBB). + ///#AARRGGBB A "#" character followed by four two-digit hexadecimal numbers (i.e. #AARRGGBB). HexArgb = 1, } @@ -86,7 +86,7 @@ pub enum NameFormat { #[repr(u32)] #[derive(Clone, Copy, PartialEq, Debug)] #[allow(non_camel_case_types)] -pub enum Spec { +pub enum QColorSpec { Invalid = 0, Rgb = 1, Hsv = 2, @@ -295,7 +295,7 @@ impl QColor { }) } - pub fn convert_to(&self, color_spec: Spec) -> QColor { + pub fn convert_to(&self, color_spec: QColorSpec) -> QColor { cpp!(unsafe [self as "const QColor*", color_spec as "QColor::Spec"] -> QColor as "QColor" { return self->convertTo(color_spec); }) @@ -557,7 +557,7 @@ impl QColor { }) } - pub fn name_with_format(&self, format: NameFormat) -> QString { + pub fn name_with_format(&self, format: QColorNameFormat) -> QString { cpp!(unsafe [self as "const QColor*", format as "QColor::NameFormat"] -> QString as "QString" { return self->name(format); }) @@ -749,8 +749,8 @@ impl QColor { }) } - pub fn spec(&self) -> Spec { - cpp!(unsafe [self as "const QColor*"] -> Spec as "QColor::Spec" { return self->spec(); }) + pub fn spec(&self) -> QColorSpec { + cpp!(unsafe [self as "const QColor*"] -> QColorSpec as "QColor::Spec" { return self->spec(); }) } pub fn to_cmyk(&self) -> QColor { @@ -809,6 +809,7 @@ impl QColor { } } +#[cfg(test)] mod tests { use super::*; diff --git a/qttypes/src/lib.rs b/qttypes/src/lib.rs index 41f1313b..2b832a5d 100644 --- a/qttypes/src/lib.rs +++ b/qttypes/src/lib.rs @@ -135,7 +135,7 @@ mod core; pub use crate::core::{qreal, QByteArray, QString, QUrl}; mod gui; -pub use crate::gui::{NameFormat, QColor, QRgb, QRgba64, Spec}; +pub use crate::gui::{QColor, QColorNameFormat, QColorSpec, QRgb, QRgba64}; #[cfg(no_qt)] mod no_qt { pub fn panic() -> T {