not adding song_model to song_editor
This will need to wait until I can clearly say that I've figured out how nested qobjects is supposed to work
This commit is contained in:
parent
69f053ffd3
commit
b589cb2490
1 changed files with 11 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
use crate::songs::song_model::song_model::SongModel;
|
||||
// use crate::songs::song_model::song_model::SongModel;
|
||||
|
||||
#[cxx_qt::bridge]
|
||||
pub mod song_editor {
|
||||
|
@ -16,8 +16,8 @@ pub mod song_editor {
|
|||
type QStringList = cxx_qt_lib::QStringList;
|
||||
include!("cxx-qt-lib/qlist.h");
|
||||
type QList_QString = cxx_qt_lib::QList<QString>;
|
||||
#[cxx_name = "SongModel"]
|
||||
type SongModel = crate::songs::song_model::qobject::SongModel;
|
||||
// #[cxx_name = "SongModel"]
|
||||
// type SongModel = crate::songs::song_model::qobject::SongModel;
|
||||
}
|
||||
|
||||
unsafe extern "RustQt" {
|
||||
|
@ -38,7 +38,7 @@ pub mod song_editor {
|
|||
#[qproperty(i32, font_size)]
|
||||
#[qproperty(bool, background_exists)]
|
||||
#[qproperty(bool, audio_exists)]
|
||||
#[qproperty(*mut SongModel, song_model)]
|
||||
// #[qproperty(*mut SongModel, song_model)]
|
||||
type SongEditor = super::SongEditorRust;
|
||||
|
||||
#[qinvokable]
|
||||
|
@ -69,7 +69,7 @@ pub struct SongEditorRust {
|
|||
font_size: i32,
|
||||
background_exists: bool,
|
||||
audio_exists: bool,
|
||||
song_model: *mut SongModel,
|
||||
// song_model: *mut SongModel,
|
||||
}
|
||||
|
||||
impl Default for SongEditorRust {
|
||||
|
@ -90,17 +90,18 @@ impl Default for SongEditorRust {
|
|||
font_size: 50,
|
||||
background_exists: true,
|
||||
audio_exists: true,
|
||||
song_model: std::ptr::null_mut(),
|
||||
// song_model: std::ptr::null_mut(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl song_editor::SongEditor {
|
||||
fn idk(mut self: Pin<&mut Self>) {
|
||||
if let Some(model) = unsafe { self.song_model().as_mut() } {
|
||||
let pinned_model = unsafe { Pin::new_unchecked(model) };
|
||||
pinned_model.update_ccli(0, QString::from("idk"));
|
||||
}
|
||||
// if let Some(model) = unsafe { self.song_model().as_mut() } {
|
||||
// let pinned_model = unsafe { Pin::new_unchecked(model) };
|
||||
// pinned_model.update_ccli(0, QString::from("idk"));
|
||||
// }
|
||||
todo!();
|
||||
}
|
||||
|
||||
pub fn check_verse_order(mut self: Pin<&mut Self>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue