[Qt-interest] static function emitting signal
Chandru...
sekarwagmare at gmail.com
Thu Mar 25 06:18:08 CET 2010
yes i tried the way u suggest see ..
in .h i use
*public:
static void UserCallBack(FTR_USER_CTX ,FTR_STATE ,FTR_RESPONSE*,
FTR_SIGNAL , FTR_BITMAP_PTR );
protected:
void UserCallBackObject(FTR_USER_CTX ,FTR_STATE , FTR_RESPONSE
*,FTR_SIGNAL , FTR_BITMAP_PTR);
*
and in .cpp
inside UserCallBack()
*QtFpsThread *instance;
instance = static_cast<QtFpsThread*>(Context);
instance->UserCallBackObject(Context,StateMask,pResponse,Signal,pBitmap);
*inside UserCallBackObject
*message = "Hai" /** message is a private QString of class
QtfpsThread **/
*
its giving segmentation fault ..... and the backtrace is
Backtrace:
/usr/local/Trolltech/Qt-4.4.3/lib/libQtCore.so.4(_ZN7QStringaSERKS_+0x25)[0xe1894d]
??:0(_ZN11QtFpsThread18UserCallBackObjectEPvmPmmP10FTR_BITMAP)[0x804cbcf]
??:0(_ZN11QtFpsThread12UserCallBackEPvmPmmP10FTR_BITMAP)[0x804cc4d]
./libLinux/ftrapi.so(CheckResponse+0x60)[0x38a316]
./libLinux/ftrapi.so(CaptureFrame+0xf2)[0x38a723]
./libLinux/ftrapi.so(MTEnrollX+0x1a3)[0x38b4c4]
./libLinux/ftrapi.so(FTREnrollX+0x25)[0x38bd42]
./Qtfps(_ZN7QWidget5eventEP6QEvent+0xaf5)[0x804bcb1]
??:0(_ZN11QtFpsThread3runEv)[0x804c580]
/usr/local/Trolltech/Qt-4.4.3/lib/libQtCore.so.4(_ZN14QThreadPrivate5startEPv+0xb0)[0xdd1768]
/lib/libpthread.so.0[0x36a50b]
/lib/libc.so.6(clone+0x5e)[0x5eb6b2e]
Memory map:
00110000-00111000 r-xp 00110000 00:00 0 [vdso]
00111000-00114000 r-xp 00000000 08:02 3437369 /lib/libSegFault.so
00114000-00115000 r-xp 00002000 08:02 3437369 /lib/libSegFault.so
00115000-00116000 rwxp 00003000 08:02 3437369 /lib/libSegFault.so
00116000-0013b000 r-xp 00000000 08:02 3339255 /usr/lib/libpng12.so.0.22.0
0013b000-0013c000 rwxp 00025000 08:02 3339255 /usr/lib/libpng12.so.0.22.0
0013c000-00144000 r-xp 00000000 08:02 3339267 /usr/lib/libSM.so.6.0.0
00144000-00145000 rwxp 00007000 08:02 3339267 /usr/lib/libSM.so.6.0.0
00145000-0015c000 r-xp 00000000 08:02 3339266 /usr/lib/libICE.so.6.3.0
0015c000-0015d000 rwxp 00016000 08:02 3339266 /usr/lib/libICE.so.6.3.0
0015d000-0015f000 rwxp 0015d000 00:00 0
0015f000-00167000 r-xp 00000000 08:02 3339257 /usr/lib/libXi.so.6.0.0
On Thu, Mar 25, 2010 at 9:29 AM, Gabriel M. Beddingfield <gabrbedd at gmail.com
> wrote:
>
> Hi Chandru,
>
>
> On Thu, 25 Mar 2010, Chandru... wrote:
>
> its not working or i dont know how to use your siggestion ...
>>
>
> What about it is not working?
>
>
> see my call back function
>> void
>> QtFpsThread::UserCallBack(FTR_USER_CTX Context,FTR_STATE
>> StateMask,FTR_RESPONSE *pResponse,FTR_SIGNAL Signal,FTR_BITMAP_PTR
>> pBitmap)
>> //static function
>> {
>> LPBIOPERPARAMS lpboc = (LPBIOPERPARAMS)Context; // biometric
>>
>
> It looks to me like "FTR_USER_CTX Context" is the same as the "void* arg"
> that I mentioned. So, I would expect to see something like:
>
> void
> QtFpsThread::UserCallback(FTR_USR_CTX Context, ...)
> // static function
> {
> QtFpsThread *instance;
> instance = static_cast<QtFpsThread*>(Context);
> instance->a_non_static_member_function(
> StateMask, pResponse, Signal, pBitmap
> );
> }
>
> Does that make sense?
>
> Also, with respect to static_cast<> vs. reinterpret_cast<>... in this case
> they do the same thing because you're casting from void* (an anonymous
> pointer). However, static_cast<> is generally safer to use... since
> reinterpret_cast<> means, "Obey me, you simpleton compiler! I /know/ what
> I'm doing."
>
> -gabriel
>
>
--
WAGMARE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100325/45755e17/attachment.html
More information about the Qt-interest-old
mailing list