mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
C++: Add clear() method to SharedString (#8797)
A convenience method to reset to an empty string, like already known from std::string. ChangeLog: [C++] Added `SharedString::clear()`
This commit is contained in:
parent
9a1ccaf502
commit
68b46276af
2 changed files with 11 additions and 0 deletions
|
@ -116,6 +116,9 @@ struct SharedString
|
|||
== 0;
|
||||
}
|
||||
|
||||
/// Reset to an empty string
|
||||
void clear() { *this = std::string_view("", 0); }
|
||||
|
||||
/// Creates a new SharedString from the given number \a n. The string representation of the
|
||||
/// number uses a minimal formatting scheme: If \a n has no fractional part, the number will be
|
||||
/// formatted as an integer.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue