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;
}