@@ -814,72 +814,6 @@ fn add_to_hash(hash: *mut c_void, key: i32, value: QByteArray) {
814
814
/// Refer to the documentation of Qt::UserRole
815
815
pub const USER_ROLE : i32 = 0x0100 ;
816
816
817
- cpp_class ! (
818
- /// Wrapper for Qt's QMessageLogContext
819
- pub unsafe struct QMessageLogContext as "QMessageLogContext"
820
- ) ;
821
- impl QMessageLogContext {
822
- // Return QMessageLogContext::line
823
- pub fn line ( & self ) -> i32 {
824
- cpp ! ( unsafe [ self as "QMessageLogContext*" ] -> i32 as "int" { return self ->line; } )
825
- }
826
- // Return QMessageLogContext::file
827
- pub fn file ( & self ) -> & str {
828
- unsafe {
829
- let x = cpp ! ( [ self as "QMessageLogContext*" ] -> * const c_char as "const char*" {
830
- return self ->file;
831
- } ) ;
832
- if x. is_null ( ) {
833
- return "" ;
834
- }
835
- std:: ffi:: CStr :: from_ptr ( x) . to_str ( ) . unwrap ( )
836
- }
837
- }
838
- // Return QMessageLogContext::function
839
- pub fn function ( & self ) -> & str {
840
- unsafe {
841
- let x = cpp ! ( [ self as "QMessageLogContext*" ] -> * const c_char as "const char*" {
842
- return self ->function;
843
- } ) ;
844
- if x. is_null ( ) {
845
- return "" ;
846
- }
847
- std:: ffi:: CStr :: from_ptr ( x) . to_str ( ) . unwrap ( )
848
- }
849
- }
850
- // Return QMessageLogContext::category
851
- pub fn category ( & self ) -> & str {
852
- unsafe {
853
- let x = cpp ! ( [ self as "QMessageLogContext*" ] -> * const c_char as "const char*" {
854
- return self ->category;
855
- } ) ;
856
- if x. is_null ( ) {
857
- return "" ;
858
- }
859
- std:: ffi:: CStr :: from_ptr ( x) . to_str ( ) . unwrap ( )
860
- }
861
- }
862
- }
863
-
864
- /// Wrap Qt's QtMsgType enum
865
- #[ repr( C ) ]
866
- #[ derive( Copy , Clone , Debug ) ]
867
- pub enum QtMsgType {
868
- QtDebugMsg ,
869
- QtWarningMsg ,
870
- QtCriticalMsg ,
871
- QtFatalMsg ,
872
- QtInfoMsg ,
873
- // there is also one level defined in C++ code:
874
- // QtSystemMsg = QtCriticalMsg
875
- }
876
-
877
- /// Wrap qt's qInstallMessageHandler.
878
- /// Useful in order to forward the log to a rust logging framework
879
- pub fn install_message_handler ( logger : extern "C" fn ( QtMsgType , & QMessageLogContext , & QString ) ) {
880
- cpp ! ( unsafe [ logger as "QtMessageHandler" ] { qInstallMessageHandler( logger) ; } )
881
- }
882
-
883
817
/// Embed files and made them available to the Qt resource system.
884
818
///
885
819
/// The macro accepts an identifier with optional preceding visibility modifier,
@@ -1025,6 +959,7 @@ pub use itemmodel::*;
1025
959
pub mod listmodel;
1026
960
pub use listmodel:: * ;
1027
961
pub mod log;
962
+ pub use crate :: log:: * ;
1028
963
pub mod qtdeclarative;
1029
964
pub use qtdeclarative:: * ;
1030
965
pub mod qmetatype;
0 commit comments