Skip to main content

qtbridge_interfaces/qlist_model/
proxy_cpp_bridge.rs

1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only
3
4use qtbridge_runtime::qproxies::QCppProxy;
5use qtbridge_runtime::DynamicMetaObjectData;
6use qtbridge_type_lib::QMetaObject;
7use crate::impl_qcpp_proxy;
8
9use super::proxy_rust::QListModelProxyRust;
10#[cxx::bridge]
11pub mod ffi {
12    unsafe extern "C++" {
13        include!("qtbridge-type-lib/src/generated/core/qhash/cpp/qhash_i32_qbytearray.h");
14        type QHash_i32_QByteArray = qtbridge_type_lib::QHash_i32_QByteArray;
15        include!("qtbridge-type-lib/src/generated/core/qmetaobject/cpp/qmetaobject.h");
16        type QMetaObject = qtbridge_type_lib::QMetaObject;
17        include!("qtbridge-type-lib/src/generated/core/qmetatype/cpp/qmetatype.h");
18        type QMetaType = qtbridge_type_lib::QMetaType;
19        include!("qtbridge-runtime/src/cpp/dynamicmetaobjectdata.h");
20        type DynamicMetaObjectData = qtbridge_runtime::DynamicMetaObjectData;
21        include!("qtbridge-type-lib/src/generated/core/qmodelindex/cpp/qmodelindex.h");
22        type QModelIndex = qtbridge_type_lib::QModelIndex;
23        include!("qtbridge-type-lib/src/generated/core/qvariant/cpp/qvariant.h");
24        type QVariant = qtbridge_type_lib::QVariant;
25        include!("qtbridge-interfaces/src/qlist_model/proxy_rust_bridge.rs.h");
26        type QListModelProxyRust = super::QListModelProxyRust;
27    }
28    #[namespace = "rust::bridge"]
29    unsafe extern "C++" {
30        include!("qtbridge-interfaces/src/qlist_model/cpp/QListModelProxyCpp.h");
31        type QListModelProxyCpp;
32        # [Self = QListModelProxyCpp]
33        # [rust_name = create]
34        unsafe fn create(rust_proxy: *mut QListModelProxyRust, metaobject: *const DynamicMetaObjectData) -> *mut QListModelProxyCpp;
35        # [Self = QListModelProxyCpp]
36        # [rust_name = create_at]
37        unsafe fn createAt(rust_proxy: *mut QListModelProxyRust, metaobject: *const DynamicMetaObjectData, addr: *mut u8) -> *mut QListModelProxyCpp;
38        # [Self = QListModelProxyCpp]
39        # [rust_name = static_qmeta_object]
40        fn baseStaticMetaObject() -> &'static QMetaObject;
41        # [Self = QListModelProxyCpp]
42        # [rust_name = size_of]
43        fn sizeOfProxy() -> usize;
44        # [Self = QListModelProxyCpp]
45        # [rust_name = align_of]
46        fn alignOfProxy() -> usize;
47        # [Self = QListModelProxyCpp]
48        # [rust_name = parser_status_cast]
49        fn parserStatusCast() -> i32;
50        # [rust_name = emit_signal_cpp]
51        fn emitSignal(self: Pin<&mut Self>, signal_name: &str, argv: &[*const u8]);
52        # [rust_name = base_index]
53        fn base_index(&self, row: i32, column: i32, parent: &QModelIndex) -> QModelIndex;
54        # [rust_name = base_role_names]
55        fn base_roleNames(&self) -> QHash_i32_QByteArray;
56        # [rust_name = base_set_data]
57        fn base_setData(self: Pin<&mut Self>, index: &QModelIndex, value: &QVariant, role: i32) -> bool;
58        # [rust_name = base_remove_rows]
59        fn base_removeRows(self: Pin<&mut Self>, first: i32, count: i32, parent: &QModelIndex) -> bool;
60        # [rust_name = base_sibling]
61        fn base_sibling(&self, row: i32, column: i32, idx: &QModelIndex) -> QModelIndex;
62        # [rust_name = base_data_changed]
63        fn dataChanged(self: Pin<&mut Self>, top_left: &QModelIndex, bottom_right: &QModelIndex);
64        # [rust_name = base_begin_insert_rows]
65        fn beginInsertRows(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
66        # [rust_name = base_end_insert_rows]
67        fn endInsertRows(self: Pin<&mut Self>);
68        # [rust_name = base_begin_move_rows]
69        fn beginMoveRows(
70            self: Pin<&mut Self>,
71            source_parent: &QModelIndex,
72            source_first: i32,
73            source_last: i32,
74            destination_parent: &QModelIndex,
75            destination_child: i32,
76        );
77        # [rust_name = base_end_move_rows]
78        fn endMoveRows(self: Pin<&mut Self>);
79        # [rust_name = base_begin_remove_rows]
80        fn beginRemoveRows(self: Pin<&mut Self>, parent: &QModelIndex, first: i32, last: i32);
81        # [rust_name = base_end_remove_rows]
82        fn endRemoveRows(self: Pin<&mut Self>);
83        # [rust_name = base_begin_reset_model]
84        fn beginResetModel(self: Pin<&mut Self>);
85        # [rust_name = base_end_reset_model]
86        fn endResetModel(self: Pin<&mut Self>);
87    }
88}
89pub use ffi::QListModelProxyCpp;
90
91impl_qcpp_proxy!(ffi::QListModelProxyCpp, QListModelProxyRust);