Removing macros from qmethobject.
Didn't really help much.
This commit is contained in:
parent
b8f1cbaed7
commit
06b13ab5ad
22
src/lib.rs
22
src/lib.rs
|
@ -39,30 +39,10 @@
|
||||||
//! engine.exec();
|
//! engine.exec();
|
||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
|
use cpp::{cpp, cpp_class};
|
||||||
use qmetaobject::prelude::*;
|
use qmetaobject::prelude::*;
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
|
|
||||||
#[cfg(not(no_qt))]
|
|
||||||
use cpp::{cpp, cpp_class};
|
|
||||||
|
|
||||||
#[cfg(no_qt)]
|
|
||||||
mod no_qt {
|
|
||||||
pub fn panic<T>() -> T {
|
|
||||||
panic!("This example is not supported on Qt 6 and above")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(no_qt)]
|
|
||||||
macro_rules! cpp {
|
|
||||||
{{ $($t:tt)* }} => {};
|
|
||||||
{$(unsafe)? [$($a:tt)*] -> $ret:ty as $b:tt { $($t:tt)* } } => {
|
|
||||||
crate::no_qt::panic::<$ret>()
|
|
||||||
};
|
|
||||||
{ $($t:tt)* } => {
|
|
||||||
crate::no_qt::panic::<()>()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
cpp! {{
|
cpp! {{
|
||||||
#include <KLocalizedContext>
|
#include <KLocalizedContext>
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
|
|
Loading…
Reference in a new issue