mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 07:37:24 +00:00
Add the accessible-position-in-set
property
This commit is contained in:
parent
d00655b059
commit
67166fcc2d
11 changed files with 50 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "slint.h"
|
||||
#include "slint_testing_internal.h"
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <type_traits>
|
||||
|
@ -355,6 +356,19 @@ public:
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Returns the accessible-position-in-set of that element, if any.
|
||||
std::optional<uintptr_t> accessible_position_in_set() const
|
||||
{
|
||||
if (auto result = get_accessible_string_property(
|
||||
cbindgen_private::AccessibleStringProperty::PositionInSet)) {
|
||||
uintptr_t value = 0;
|
||||
if (cbindgen_private::slint_string_to_usize(&*result, &value)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Sets the accessible-value of that element.
|
||||
///
|
||||
/// Setting the value will invoke the `accessible-action-set-value` callback.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue