mol wrote:I have a little problem.
One of QT functions returns me a pointer. But I need to operate on object.
How to get the object from pointer?
Code: Select all
PointerToImage := ::oQTObject:Pixmap()
Image := <<<< what to do to get object???
Image := Image:ScaledToWidth(::oQTObject:width)
::oQTObject:setPixmap(Image)
I'm facing the same problem with QMenu:AddAction.
I've posted two messages about this in the Harbour users forums and I've not obtained a response yet.
This is a transcription of the messages. Maybe someone here be able to give us some clue:
Hi All,
I've created a simple test menu according demoqt.prg like this:
//
oMenu1 := QMenu():new()
oMenu1:setTitle( "&File" )
QT_SLOTS_CONNECT( s_slots, oMenu1:addAction_1( "new.png" , "&New" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } )
oMenuBar:addMenu( oMenu1 )
oWnd:setMenuBar( oMenuBar )
//
It works fine. The question is how to access to the 'new' menuitem to change its image, check status or disable it after creation.
Thanks in advance.
Roberto Lopez wrote:
> oMenu1:setTitle( "&File" )
> QT_SLOTS_CONNECT( s_slots, oMenu1:addAction_1( "new.png" , "&New" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } )
>It works fine. The question is how to access to the 'new' menuitem to
>change its image, check status or disable it after creation.
I've noted that :addaction is returning a pointer and according QT reference (if I've understood it correctly) it should be a pointer to a QAction object.
The QAction object will allow to me to change menu item properties after creation (my original question).
So, if my assumptions are correct, my problem is how to access to the QAction object from a pointer to it (returned by :addaction).
So, the question is: how to do that.
Thanks in advance.
Regards,
Roberto.