rust side builds but having trouble linking in main.cpp
This commit is contained in:
parent
fbcb6afc7a
commit
92f2b18a20
14 changed files with 377 additions and 140 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#[cxx_qt::bridge]
|
||||
pub mod slide_object {
|
||||
pub mod qobject {
|
||||
unsafe extern "C++" {
|
||||
include!("cxx-qt-lib/qstring.h");
|
||||
type QString = cxx_qt_lib::QString;
|
||||
|
|
@ -11,6 +11,28 @@ pub mod slide_object {
|
|||
}
|
||||
|
||||
unsafe extern "RustQt" {
|
||||
#[qobject]
|
||||
#[qml_element]
|
||||
#[qproperty(i32, slide_index)]
|
||||
#[qproperty(i32, slide_size)]
|
||||
#[qproperty(i32, inner_slide_index)]
|
||||
#[qproperty(bool, is_playing)]
|
||||
#[qproperty(bool, looping)]
|
||||
#[qproperty(QString, text)]
|
||||
#[qproperty(QString, ty)]
|
||||
#[qproperty(QString, audio)]
|
||||
#[qproperty(QString, image_background)]
|
||||
#[qproperty(QString, video_background)]
|
||||
#[qproperty(bool, html)]
|
||||
#[qproperty(QString, vtext_alignment)]
|
||||
#[qproperty(QString, htext_alignment)]
|
||||
#[qproperty(QString, font)]
|
||||
#[qproperty(i32, font_size)]
|
||||
#[qproperty(f32, video_start_time)]
|
||||
#[qproperty(f32, video_end_time)]
|
||||
// #[qproperty(*mut SlideModel, slide_model)]
|
||||
type SlideObject = super::SlideObjectRust;
|
||||
|
||||
#[qsignal]
|
||||
fn playing_changed(
|
||||
self: Pin<&mut SlideObject>,
|
||||
|
|
@ -35,28 +57,6 @@ pub mod slide_object {
|
|||
#[qsignal]
|
||||
fn reveal_prev(self: Pin<&mut SlideObject>);
|
||||
|
||||
#[qobject]
|
||||
#[qml_element]
|
||||
#[qproperty(i32, slide_index)]
|
||||
#[qproperty(i32, slide_size)]
|
||||
#[qproperty(i32, inner_slide_index)]
|
||||
#[qproperty(bool, is_playing)]
|
||||
#[qproperty(bool, looping)]
|
||||
#[qproperty(QString, text)]
|
||||
#[qproperty(QString, ty)]
|
||||
#[qproperty(QString, audio)]
|
||||
#[qproperty(QString, image_background)]
|
||||
#[qproperty(QString, video_background)]
|
||||
#[qproperty(bool, html)]
|
||||
#[qproperty(QString, vtext_alignment)]
|
||||
#[qproperty(QString, htext_alignment)]
|
||||
#[qproperty(QString, font)]
|
||||
#[qproperty(i32, font_size)]
|
||||
#[qproperty(f32, video_start_time)]
|
||||
#[qproperty(f32, video_end_time)]
|
||||
// #[qproperty(*mut SlideModel, slide_model)]
|
||||
type SlideObject = super::SlideObjectRust;
|
||||
|
||||
#[qinvokable]
|
||||
fn change_slide(
|
||||
self: Pin<&mut SlideObject>,
|
||||
|
|
@ -89,11 +89,11 @@ use cxx_qt_lib::{CaseSensitivity, QString, QVariant};
|
|||
use tracing::{debug, error};
|
||||
|
||||
use crate::{
|
||||
slide_model::{slide_model, Slide},
|
||||
slide_model::{Slide, slide_model},
|
||||
slide_types::SlideType,
|
||||
};
|
||||
|
||||
use self::slide_object::QMap_QString_QVariant;
|
||||
use self::qobject::QMap_QString_QVariant;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct SlideObjectRust {
|
||||
|
|
@ -142,7 +142,7 @@ impl Default for SlideObjectRust {
|
|||
}
|
||||
}
|
||||
|
||||
impl slide_object::SlideObject {
|
||||
impl qobject::SlideObject {
|
||||
pub fn change_slide(
|
||||
mut self: Pin<&mut Self>,
|
||||
item: QMap_QString_QVariant,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue