On Tue, 19 Sep 2006 21:44:10 -0300
"Felipe Monteiro de Carvalho" <[EMAIL PROTECTED]> wrote:

> Ok, something very strange is going on.
> 
> I added a slot for the itemchanged signal that looks like this:
> 
> procedure TQtListWidget.SlotSelectionChange(current: QListWidgetItemH;
>   previous: QListWidgetItemH); cdecl;
> var
>   Msg: TLMessage;
> begin
>   FillChar(Msg, SizeOf(Msg), #0);
> 
>   Msg.Msg := LM_SELCHANGE;
> 
>   try
>     LCLObject.WindowProc(TLMessage(Msg));
>   except
>     Application.HandleException(nil);
>   end;
> end;
> 
> If I comment out the LCLObject.WindowProc() line, no events are
> received for the listbox.
> 
> If I don't commen it and click on the list box and drag to change
> selection, I will receive many OnClick and OnSelectionChange events.
> 
> Could it be a problem with the qt bindings?
> 
> It seams to me everything I did was correct. Here is my SetSlots
> function, I not only use a events look, but alse set a slot for a
> signal directly, because that signal has no corresponding event:
> 
> class procedure TQtWSCustomListBox.SetSlots(const QtListWidget:
> TQtListWidget); var
>   Method: TMethod;
>   Hook : QListWidget_hookH;
> begin
>   // Various Events
> 
>   Hook := QListWidget_hook_create(QtListWidget.Widget);
> 
>   TEventFilterMethod(Method) := QtListWidget.EventFilter;
> 
>   QObject_hook_hook_events(Hook, Method);
> 
>   // OnSelectionChange event
> 
>   QListWidget_currentItemChanged_Event(Method) :=
> QtListWidget.SlotSelectionChange;
> 
>   QListWidget_hook_hook_currentItemChanged(Hook, Method);
> end;
> 
> I also attached a diff.

Is this for testing or should it be applied to svn?

Mattias

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to