Struct cxx_qt_lib::QColor
source · [−]pub struct QColor { /* private fields */ }
Expand description
The Rust representation of Qt’s QColor
Internally this holds a UniquePtr to a QColorCpp which has been constructed on the C++ side.
Implementations
sourceimpl QColor
impl QColor
sourcepub fn from_qcolor(color: &QColorCpp) -> Self
pub fn from_qcolor(color: &QColorCpp) -> Self
Construct a Rust QColor from an existing QColorCpp, this is a copy operation.
sourcepub fn from_rgba(red: i32, green: i32, blue: i32, alpha: i32) -> Self
pub fn from_rgba(red: i32, green: i32, blue: i32, alpha: i32) -> Self
Constructs a QColor with the RGB value r, g, b, and the alpha-channel (transparency) value of a.
The color is left invalid if any of the arguments are invalid.
sourcepub fn set_alpha(&mut self, alpha: i32)
pub fn set_alpha(&mut self, alpha: i32)
Sets the alpha of this color to alpha. Integer alpha is specified in the range 0-255.
sourcepub fn set_blue(&mut self, blue: i32)
pub fn set_blue(&mut self, blue: i32)
Sets the blue color component of this color to blue. Integer components are specified in the range 0-255.
Trait Implementations
sourceimpl ToUniquePtr for QColor
impl ToUniquePtr for QColor
sourcefn to_unique_ptr(self) -> UniquePtr<QColorCpp>
fn to_unique_ptr(self) -> UniquePtr<QColorCpp>
Retrieve the UniquePtr to the Qt QColorCpp of this Rust QColor so that this object can be passed back to C++.
type CppType = QColor
Auto Trait Implementations
impl RefUnwindSafe for QColor
impl !Send for QColor
impl !Sync for QColor
impl !Unpin for QColor
impl UnwindSafe for QColor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more