From 740f28325a7d036285fdad0c47cfb42d413d4536 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 27 Feb 2011 11:20:52 +0000 Subject: [PATCH] 2011-02-27 12:19 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/qtcore/hbqt.h + Added HBQT_SLOT_CALLBACK_OBJ_1() macro to easily create slot callbacks passing 1 object. ; TODO: Use it. --- harbour/ChangeLog | 12 +++++++----- harbour/contrib/hbqt/qtcore/hbqt.h | 11 +++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 2df966384a..adb2f262a9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,14 +16,16 @@ The license applies to all entries newer than 2009-04-28. */ +2011-02-27 12:19 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbqt/qtcore/hbqt.h + + Added HBQT_SLOT_CALLBACK_OBJ_1() macro to easily create + slot callbacks passing 1 object. + ; TODO: Use it. + 2011-02-27 11:17 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/qtcore/hbqt_hbqslots.cpp ! Patch from Francesco. -2011-02-27 11:08 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) - * examples/hbqt_tut/win11.prg - % Optimized to use embedded .ui. Noted by Rafal. - 2011-02-27 11:06 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbqt/qtgui/hbqt_init.cpp * contrib/hbqt/qtgui/hbqt_hbqgraphicsitem.cpp @@ -164,7 +166,7 @@ which means _ALL_ HBQT apps now require to pull and link every existing QT symbols to work reliably, which is unacceptable for all apps (except HBIDE which pulls all - these anyway) + these anyway) [DONE] We should move to full C++ wrappers to solve this cleanly. ; TOFIX: Clean code to never use the unsafe hbqt_create_objectFromEventType(). [DONE] diff --git a/harbour/contrib/hbqt/qtcore/hbqt.h b/harbour/contrib/hbqt/qtcore/hbqt.h index e0f304bc0e..3e6a6db8ac 100644 --- a/harbour/contrib/hbqt/qtcore/hbqt.h +++ b/harbour/contrib/hbqt/qtcore/hbqt.h @@ -111,4 +111,15 @@ HB_EXTERN_END #define hbqt_par_Bool( n ) ( hb_parl( n ) ) #define hbqt_par_char( n ) ( hb_parcx( n ) ) +#define HBQT_SLOT_CALLBACK_OBJ_1( _name_ ) \ + static void hbqt_SlotsExec##_name_( PHB_ITEM * codeBlock, void ** arguments, QStringList pList ) \ + { \ + Q_UNUSED( pList ); \ + \ + hb_vmPushEvalSym(); \ + hb_vmPush( codeBlock ); \ + hb_vmPush( hbqt_create_object( hbqt_gcAllocate_##_name_( new _name_( ( *reinterpret_cast< _name_( * ) >( arguments[ 1 ] ) ) ), true ), HB_MACRO2STRING( _name_ ) ) ); \ + hb_vmSend( 1 ); \ + } + #endif /* __HBQT_H */