Hi

Viktor Szakáts wrote:
> 
>> Method QPixmap:new(...)
>>   LOCAL aP := hb_aParams()
>> 
>>   aeval( aP, {|x| x := hbqt_ptr( x ) } )
>> 
>>   Qt_QPixmap(...)  /* How this can be achieved with above syntax */
>> 
>>   RETURN Self
> 
> Why should this conversion be done on the object wrapper level?
> Why can't you do this conversion in QT_QPIXMAP()?
> F.e. in hb_gcpointer()?
> 

Because if I implement it QT_QPIXMAP() I have to 
touch around 100 .qth headers which is not viable at this point.
So I am introducing in generator:

METHOD QSomePlainObject:new( ... )
   LOCAL p
   LOCAL aP := hb_aParams()
   LOCAL nParams := len( aP )

   IF nParams > 0
       FOR EACH p IN aP
          p := hbqt_ptr( p )
       NEXT
   ENDIF

   DO CASE
   CASE nParams == 6
      ::pPtr := Qt_QSomePlainObject( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[
5 ], aP[ 6 ] )
   CASE nParams == 5
      ::pPtr := Qt_QSomePlainObject( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ], aP[
5 ] )
   CASE nParams == 4
      ::pPtr := Qt_QSomePlainObject( aP[ 1 ], aP[ 2 ], aP[ 3 ], aP[ 4 ] )
   CASE nParams == 3
      ::pPtr := Qt_QSomePlainObject( aP[ 1 ], aP[ 2 ], aP[ 3 ] )
   CASE nParams == 2
      ::pPtr := Qt_QSomePlainObject( aP[ 1 ], aP[ 2 ] )
   CASE nParams == 1
      ::pPtr := Qt_QSomePlainObject( aP[ 1 ] )
   OTHERWISE
      ::pPtr :=  Qt_QSomePlainObject()  
   ENDCASE

   return self


I am aware of its limitation but I could not find a better way.
Because it is a one-time code, so it carris no overhead.
If anybody has better solution please forward.

Regards
Pritpal Bedi

-- 
View this message in context: 
http://old.nabble.com/SF.net-SVN%3A-harbour-project%3A-13275--trunk-harbour-tp26826400p26849574.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to