@@ -128,40 +128,47 @@ use std::ops::{Index, IndexMut};
128
128
#[ cfg( feature = "chrono" ) ]
129
129
use chrono:: prelude:: * ;
130
130
131
- #[ cfg( not( no_qt) ) ]
132
- use cpp:: { cpp, cpp_class} ;
133
-
134
- mod core;
135
- pub use crate :: core:: { qreal, QByteArray , QString , QUrl } ;
136
-
137
- mod gui;
138
- pub use crate :: gui:: { QColor , QColorNameFormat , QColorSpec , QRgb , QRgba64 } ;
139
131
#[ cfg( no_qt) ]
140
- mod no_qt {
132
+ pub ( crate ) mod no_qt {
141
133
pub fn panic < T > ( ) -> T {
142
134
panic ! ( "Qt was not found during build" )
143
135
}
144
136
}
145
137
146
- #[ cfg( no_qt) ]
147
- macro_rules! cpp {
148
- { { $( $t: tt) * } } => { } ;
149
- { $( unsafe ) ? [ $( $a: tt) * ] -> $ret: ty as $b: tt { $( $t: tt) * } } => {
150
- crate :: no_qt:: panic:: <$ret>( )
151
- } ;
152
- { $( $t: tt) * } => {
153
- crate :: no_qt:: panic:: <( ) >( )
154
- } ;
155
- }
138
+ pub ( crate ) mod internal_prelude {
139
+ #[ cfg( not( no_qt) ) ]
140
+ pub ( crate ) use cpp:: { cpp, cpp_class} ;
141
+ #[ cfg( no_qt) ]
142
+ macro_rules! cpp {
143
+ { { $( $t: tt) * } } => { } ;
144
+ { $( unsafe ) ? [ $( $a: tt) * ] -> $ret: ty as $b: tt { $( $t: tt) * } } => {
145
+ crate :: no_qt:: panic:: <$ret>( )
146
+ } ;
147
+ { $( $t: tt) * } => {
148
+ crate :: no_qt:: panic:: <( ) >( )
149
+ } ;
150
+ }
156
151
157
- #[ cfg( no_qt) ]
158
- macro_rules! cpp_class {
159
- ( $( #[ $( $attrs: tt) * ] ) * $vis: vis unsafe struct $name: ident as $type: expr) => {
160
- #[ derive( Default , Ord , Eq , PartialEq , PartialOrd , Clone , Copy ) ]
161
- #[ repr( C ) ]
162
- $vis struct $name;
163
- } ;
152
+ #[ cfg( no_qt) ]
153
+ macro_rules! cpp_class {
154
+ ( $( #[ $( $attrs: tt) * ] ) * $vis: vis unsafe struct $name: ident as $type: expr) => {
155
+ #[ derive( Default , Ord , Eq , PartialEq , PartialOrd , Clone , Copy ) ]
156
+ #[ repr( C ) ]
157
+ $vis struct $name;
158
+ } ;
159
+ }
160
+ #[ cfg( no_qt) ]
161
+ pub ( crate ) use cpp;
162
+ #[ cfg( no_qt) ]
163
+ pub ( crate ) use cpp_class;
164
164
}
165
+ use internal_prelude:: * ;
166
+
167
+ mod core;
168
+ pub use crate :: core:: { qreal, QByteArray , QString , QUrl } ;
169
+
170
+ mod gui;
171
+ pub use crate :: gui:: { QColor , QColorNameFormat , QColorSpec , QRgb , QRgba64 } ;
165
172
166
173
cpp ! { {
167
174
#include <QtCore /QByteArray >
0 commit comments