1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
use cxx::{type_id, ExternType};
use std::fmt;
use std::mem::MaybeUninit;
#[cxx::bridge]
mod ffi {
unsafe extern "C++" {
include!("cxx-qt-lib/qpersistentmodelindex.h");
include!("cxx-qt-lib/qstring.h");
type QPersistentModelIndex = super::QPersistentModelIndex;
type QString = crate::QString;
include!("cxx-qt-lib/qmodelindex.h");
type QModelIndex = crate::QModelIndex;
fn column(self: &QPersistentModelIndex) -> i32;
#[rust_name = "is_valid"]
fn isValid(self: &QPersistentModelIndex) -> bool;
fn parent(self: &QPersistentModelIndex) -> QModelIndex;
fn row(self: &QPersistentModelIndex) -> i32;
fn sibling(self: &QPersistentModelIndex, row: i32, column: i32) -> QModelIndex;
}
#[namespace = "rust::cxxqtlib1"]
unsafe extern "C++" {
include!("cxx-qt-lib/common.h");
#[doc(hidden)]
#[rust_name = "qpersistentmodelindex_drop"]
fn drop(string: &mut QPersistentModelIndex);
#[doc(hidden)]
#[rust_name = "qpersistentmodelindex_from_qmodelindex"]
fn construct(index: &QModelIndex) -> QPersistentModelIndex;
#[doc(hidden)]
#[rust_name = "qpersistentmodelindex_clone"]
fn construct(other: &QPersistentModelIndex) -> QPersistentModelIndex;
#[doc(hidden)]
#[rust_name = "qpersistentmodelindex_eq"]
fn operatorEq(a: &QPersistentModelIndex, b: &QPersistentModelIndex) -> bool;
#[doc(hidden)]
#[rust_name = "qpersistentmodelindex_to_qstring"]
fn toQString(value: &QPersistentModelIndex) -> QString;
}
}
#[repr(C)]
pub struct QPersistentModelIndex {
_space: MaybeUninit<usize>,
}
impl Clone for QPersistentModelIndex {
fn clone(&self) -> Self {
ffi::qpersistentmodelindex_clone(self)
}
}
impl Drop for QPersistentModelIndex {
fn drop(&mut self) {
ffi::qpersistentmodelindex_drop(self)
}
}
impl From<&crate::QModelIndex> for QPersistentModelIndex {
fn from(index: &crate::QModelIndex) -> Self {
ffi::qpersistentmodelindex_from_qmodelindex(index)
}
}
impl std::cmp::PartialEq for QPersistentModelIndex {
fn eq(&self, other: &Self) -> bool {
ffi::qpersistentmodelindex_eq(self, other)
}
}
impl std::cmp::Eq for QPersistentModelIndex {}
impl fmt::Display for QPersistentModelIndex {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", ffi::qpersistentmodelindex_to_qstring(self))
}
}
impl fmt::Debug for QPersistentModelIndex {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{self}")
}
}
unsafe impl ExternType for QPersistentModelIndex {
type Id = type_id!("QPersistentModelIndex");
type Kind = cxx::kind::Trivial;
}