Removing macros from qmethobject.

Didn't really help much.
This commit is contained in:
Ayush Singh 2021-12-01 06:54:07 +05:30
parent b8f1cbaed7
commit 06b13ab5ad

View file

@ -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>