attempting to switch to new version of cxx-qt to try newer api

This commit is contained in:
Chris Cochrun 2023-10-11 11:09:07 -05:00
parent d82a0ac503
commit 5163a39317
6 changed files with 170 additions and 161 deletions

View file

@ -24,6 +24,13 @@ mod service_item_model {
type QUrl = cxx_qt_lib::QUrl;
}
// extern "RustQt" {
// #[qobject]
// #[base = "QAbstractListModel"]
// #[qml_element]
// type ServiceItemModel = super::ServiceItemMod;
// }
use serde::{Deserialize, Serialize};
#[cxx_qt::qobject]
#[derive(Clone, Debug)]
@ -1130,15 +1137,6 @@ mod service_item_model {
);
// cxx-qt can't build this function for some reason
// unsafe fn begin_move_rows(
// self: Pin<&mut qobject::ServiceItemMod>,
// source_parent: &QModelIndex,
// source_first: i32,
// source_last: i32,
// destination_parent: &QModelIndex,
// destination_child: i32,
// );
unsafe fn end_move_rows(
self: Pin<&mut qobject::ServiceItemMod>,
);
@ -1169,6 +1167,17 @@ mod service_item_model {
parent: &QModelIndex,
) -> bool;
#[cxx_name = "beginMoveRows"]
fn begin_move_rows(
self: Pin<&mut qobject::ServiceItemMod>,
#[cxx_name = "sourceParent"] source_parent: &QModelIndex,
#[cxx_name = "sourceFirst"] source_first: i32,
#[cxx_name = "sourceLast"] source_last: i32,
#[cxx_name = "destinationParent"]
destination_parent: &QModelIndex,
#[cxx_name = "desitnationChild"] destination_child: i32,
);
fn index(
self: &qobject::ServiceItemMod,
row: i32,