Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2006-12

Storing custom data in QWidget

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jesus Reyes

Hi, I'm trying to get StringGrid working in QT interface, so I'm doing some experiments to know what it's missing, and I fixed/implemented a number of features and it seems to work, yet there are many things that need to be implemented.

Currently I'm dealing with focus, I'm using
QApplication_FocusWidget() to get the focused QWidgetH, the problem is I need the Corresponding TQtWidget which is the handle that GetFocus should return.

I would like to store custom data in QWidget instance, is there any way to do it? This is How it should work (ideally).

constructor TQtWidget.Create(WinControl,Params)
begin
   ...
   Widget:=QWidget_Create(); // a std QWidget
   // QWidget_SetData(QWidgetH,String,Pointer)
   QWidget_SetData(Widget, 'Handle', Self);
   ...
end;

This way, QWidgetH would be associated to WinControl, at the moment, TQTWidget is associated to WinControl through LCLObject.

This could be also useful to implemet SetProp and GetProp Widgetset functions though currently I have implemented these in TQtWidget.

Another thing, keymodifiers cannot be retrieved using QMouseEventH, QMouseEvent_modifiers or QMouseEvent_to_QInputEvent() function is missing, this is needed to get shift state into LCL mouse msg.

Jesus Reyes A.

__________________________________________________ Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ?gratis! Reg?strate ya - http://correo.yahoo.com.mx/

Den Jean
to Jesus Reyes
Jesus Reyes wrote
Another thing, keymodifiers cannot be retrieved using QMouseEventH, QMouseEvent_modifiers

QMouseEvent inherits from QInputEvent.
Use following function using the handle of your QMouseEvent. function QInputEvent_modifiers(handle: QInputEventH): QtKeyboardModifiers;

or QMouseEvent_to_QInputEvent() function is

Such a function is not necessary, usage see above.

Sometimes there are ClassA_To_ClassB functions.
See wiki why:
http://www.freepascal.org/wiki/index.php/Qt4_binding#C.2B.2B_Multiple_inheritance

missing, this is needed to get shift state into LCL mouse msg.

regards,

Den Jean

Jesús Reyes A.
to Den Jean

----- Original Message -----

Earlier message 43 lines
From: "Den Jean" To: "Items specific to the Qt widget set" Sent: Thursday, December 28, 2006 4:04 AM Subject: Re: [Qt] Storing custom data in QWidget > On Thursday 28 December 2006 00:55, Jesus Reyes wrote: >> Another thing, keymodifiers cannot be retrieved using QMouseEventH, >> QMouseEvent_modifiers > QMouseEvent inherits from QInputEvent. > Use following function using the handle of your QMouseEvent. > function QInputEvent_modifiers(handle: QInputEventH): QtKeyboardModifiers; > > >> or QMouseEvent_to_QInputEvent() function is > Such a function is not necessary, usage see above. > > Sometimes there are ClassA_To_ClassB functions. > See wiki why: > http://www.freepascal.org/wiki/index.php/Qt4_binding#C.2B.2B_Multiple_inheritance > >> missing, this is needed to get shift state into LCL mouse msg. > > > regards, > > Den Jean :) In fact I based my comment on that article, I thought QMouseEvent inherites from QEvent and QInputEvent because in QT docs it says: "1 public function inherited from QInputEvent 6 public functions inherited from QEvent" As I didn't look at the source to find from what class it inherits first, I though that QEvent was more logical from the name, I see I was wrong :) And, what about the other part. Storing custom data in QWidget, any idea? Jesus Reyes A. __________________________________________________ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ?gratis! Reg?strate ya - http://correo.yahoo.com.mx/