fixing name clobbering in qobjects.
Apparently qobjects need unique names or else they will name clobber.
This commit is contained in:
parent
b4ce082891
commit
27acbdc866
11 changed files with 40 additions and 38 deletions
|
@ -1,5 +1,5 @@
|
|||
#[cxx_qt::bridge]
|
||||
pub mod qobject {
|
||||
pub mod song_model {
|
||||
unsafe extern "C++" {
|
||||
include!(< QAbstractListModel >);
|
||||
include!("cxx-qt-lib/qhash.h");
|
||||
|
@ -242,7 +242,7 @@ pub mod qobject {
|
|||
|
||||
use crate::models::*;
|
||||
use crate::schema::songs::dsl::*;
|
||||
use crate::songs::song_editor::qobject::QList_QString;
|
||||
use crate::songs::song_editor::song_editor::QList_QString;
|
||||
use cxx_qt::CxxQtType;
|
||||
use cxx_qt_lib::{
|
||||
QByteArray, QModelIndex, QString, QStringList, QVariant,
|
||||
|
@ -254,7 +254,7 @@ use std::pin::Pin;
|
|||
use std::slice::Iter;
|
||||
use tracing::{debug, debug_span, error, info, instrument};
|
||||
|
||||
use self::qobject::{
|
||||
use self::song_model::{
|
||||
QHash_i32_QByteArray, QMap_QString_QVariant, QVector_i32,
|
||||
SongRoles,
|
||||
};
|
||||
|
@ -296,7 +296,7 @@ pub struct SongModelRust {
|
|||
inner_songs: Vec<Song>,
|
||||
}
|
||||
|
||||
impl qobject::SongModel {
|
||||
impl song_model::SongModel {
|
||||
pub fn clear(mut self: Pin<&mut Self>) {
|
||||
unsafe {
|
||||
self.as_mut().begin_reset_model();
|
||||
|
@ -1098,7 +1098,7 @@ impl qobject::SongModel {
|
|||
}
|
||||
|
||||
// QAbstractListModel implementation
|
||||
impl qobject::SongModel {
|
||||
impl song_model::SongModel {
|
||||
fn data(&self, index: &QModelIndex, role: i32) -> QVariant {
|
||||
let role = SongRoles { repr: role };
|
||||
if let Some(song) = self.songs.get(index.row() as usize) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue