mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-03 05:12:55 +00:00
C++: Improve reliability of comparison operator of slint::Image
Call into the Rust implementation, so that we have to maintain only one implementation.
This commit is contained in:
parent
f51ca82f10
commit
084ff70079
3 changed files with 13 additions and 2 deletions
|
|
@ -199,9 +199,12 @@ public:
|
|||
}
|
||||
|
||||
/// Returns true if \a a refers to the same image as \a b; false otherwise.
|
||||
friend bool operator==(const Image &a, const Image &b) { return a.data == b.data; }
|
||||
friend bool operator==(const Image &a, const Image &b)
|
||||
{
|
||||
return cbindgen_private::types::slint_image_compare_equal(&a.data, &b.data);
|
||||
}
|
||||
/// Returns false if \a a refers to the same image as \a b; true otherwise.
|
||||
friend bool operator!=(const Image &a, const Image &b) { return a.data != b.data; }
|
||||
friend bool operator!=(const Image &a, const Image &b) { return !(a == b); }
|
||||
|
||||
/// \private
|
||||
explicit Image(cbindgen_private::types::Image inner) : data(inner) { }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue