Sign in Join

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

Mailing lists / qt / 2008-03

FocusChanged changes

16 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Paul Ishenin

Hello, Items specific to the Qt widget set

I removed SlotFocus of TQtWidget and added application FocusChanged hook to listen for all focus events in r14361. Also I removed piece of code on FocusOut event that Zeljan added few months ago (related with releaseMouse). Zeljan, please take a look - I hope that with new code we dont need that piece of code anymore.

Best regards,
Paul Ishenin.

Reply by email

zeljko
to Paul Ishenin
Paul Ishenin wrote 7 lines
Hello, Items specific to the Qt widget set I removed SlotFocus of TQtWidget and added application FocusChanged hook to listen for all focus events in r14361. Also I removed piece of code on FocusOut event that Zeljan added few months ago (related with releaseMouse). Zeljan, please take a look - I hope that with new code we dont need that piece of code anymore.

I'll test it immediatelly and let you know about any behaviour change.

Reply by email

zeljko
to Paul Ishenin: Hello, Items specific to the Qt widget set I removed SlotFocus of TQtWidget and added…
Paul Ishenin wrote 7 lines
Hello, Items specific to the Qt widget set I removed SlotFocus of TQtWidget and added application FocusChanged hook to listen for all focus events in r14361. Also I removed piece of code on FocusOut event that Zeljan added few months ago (related with releaseMouse). Zeljan, please take a look - I hope that with new code we dont need that piece of code anymore.

huh, at first look MDI is completely broken (SEGFAULT) - if you try to move MDI child ...

Program received signal SIGSEGV, Segmentation fault. QWidget::setFocus (this=0x9c4af40, reason=96) at qwidget.h:873 873 qwidget.h: No such file or directory.
in qwidget.h
Current language: auto; currently c++
(gdb) bt
#0 QWidget::setFocus (this=0x9c4af40, reason=96) at qwidget.h:873 #1 0x066e71e2 in QApplicationPrivate::closePopup (this=0x9bd0818, popup=0x9c23468) at kernel/qapplication_x11.c
#2 0x066d676b in QWidgetPrivate::hide_helper (this=0x9c26fe0) at qapplication.h:97
#3 0x066d728d in QWidget::setVisible (this=0x9c23468, visible=false) at kernel/qwidget.cpp:5648
#4 0x06a05ca3 in QMenuPrivate::hideUpToMenuBar (this=0x9c26fe0) at qwidget.h:456
#5 0x06a06176 in QMenuPrivate::activateAction (this=0x9c26fe0, action=0x9c34398, action_e=QAction::Trigger, sel
#6 0x06a0879a in QMenu::mouseReleaseEvent (this=0x9c34398, e=0xbf85bf68) at widgets/qmenu.cpp:2061
#7 0x066d5c9a in QWidget::event (this=0x9c23468, event=0xbf85bf68) at kernel/qwidget.cpp:6145
#8 0x06a03a0c in QMenu::event (this=0x9c23468, e=0xbf85bf68) at widgets/qmenu.cpp:2156
#9 0x06693144 in QApplicationPrivate::notify_helper (this=0x9bd0818, receiver=0x9c23468, e=0xbf85bf68) at kerne
#10 0x06693e30 in QApplication::notify (this=0x9bd0808, receiver=0x9c23468, e=0xbf85bf68) at kernel/qapplication
#11 0x007c2ec0 in QCoreApplication::notifyInternal (this=0x9bd0808, receiver=0x9c23468, event=0xbf85bf68) at ker
#12 0x066ed5a6 in QETWidget::translateMouseEvent (this=0x9c23468, event=0xbf85c4c8) at qcoreapplication.h:210
#13 0x066ec1e3 in QApplication::x11ProcessEvent (this=0x9bd0808, event=0xbf85c4c8) at kernel/qapplication_x11.cp
#14 0x0670ea82 in x11EventSourceDispatch (s=0x9bd86d0, callback=0, user_data=0x60) at qcoreapplication.h:97
#15 0x003e3a51 in g_main_context_dispatch () from /lib/libglib-2.0.so.0 #16 0x003e52a2 in g_main_context_acquire () from /lib/libglib-2.0.so.0 #17 0x003e572a in g_main_context_iteration () from /lib/libglib-2.0.so.0 #18 0x007e3e6a in QEventDispatcherGlib::processEvents (this=0x9bd5580, flags={i = 20}) at kernel/qeventdispatche
#19 0x0670e59f in QGuiEventDispatcherGlib::processEvents (this=0x9bd5580, flags={i = 113493872}) at qglobal.h:17
#20 0x007c2f46 in QCoreApplication::processEvents (flags=Cannot access memory at address 0x60
) at qglobal.h:1780
#21 0x05cc6102 in QCoreApplication_processEvents () from /usr/lib/libqt4intf.so
#22 0x081bc44e in TQTWIDGETSET__APPWAITMESSAGE (this=0x4009b048) at qtobject.inc:167
#23 0x0807bd62 in TAPPLICATION__IDLE (WAIT=true, this=0x40093048) at application.inc:315
#24 0x0807d37f in TAPPLICATION__HANDLEMESSAGE (this=0x40093048) at application.inc:966
#25 0x0807d744 in RUNMESSAGE (parentfp=0xbf85c7c4) at application.inc:1079 #26 0x0807d69e in TAPPLICATION__RUNLOOP (this=0x40093048) at application.inc:1089
#27 0x081bc423 in TQTWIDGETSET__APPRUN (ALOOP=0x807d660 <TAPPLICATION__RUNLOOP>, this=0x4009b048) at qtobject.in #28 0x0807d65a in TAPPLICATION__RUN (this=0x40093048) at application.inc:1068 #29 0x08056e89 in main () at project1.lpr:14

Reply by email

zeljko
to Paul Ishenin: Hello, Items specific to the Qt widget set I removed SlotFocus of TQtWidget and added…
Paul Ishenin wrote 7 lines
Hello, Items specific to the Qt widget set I removed SlotFocus of TQtWidget and added application FocusChanged hook to listen for all focus events in r14361. Also I removed piece of code on FocusOut event that Zeljan added few months ago (related with releaseMouse). Zeljan, please take a look - I hope that with new code we dont need that piece of code anymore.

without FocusChanged it doesn't segfault with MDI .

Reply by email

Paul Ishenin
to zeljko
zeljko wrote 13 lines
On Sunday 02 March 2008 07:16, Paul Ishenin wrote: > Hello, Items specific to the Qt widget set > > I removed SlotFocus of TQtWidget and added application FocusChanged hook > to listen for all focus events in r14361. Also I removed piece of code > on FocusOut event that Zeljan added few months ago (related with > releaseMouse). Zeljan, please take a look - I hope that with new code we > dont need that piece of code anymore. > without FocusChanged it doesn't segfault with MDI .

Please send me small test application.

Best regards,
Paul Ishenin.

Reply by email

zeljko
to Paul Ishenin
Paul Ishenin wrote 13 lines
zeljko wrote: > On Sunday 02 March 2008 07:16, Paul Ishenin wrote: >> Hello, Items specific to the Qt widget set >> >> I removed SlotFocus of TQtWidget and added application FocusChanged hook >> to listen for all focus events in r14361. Also I removed piece of code >> on FocusOut event that Zeljan added few months ago (related with >> releaseMouse). Zeljan, please take a look - I hope that with new code we >> dont need that piece of code anymore. > > without FocusChanged it doesn't segfault with MDI . Please send me small test application.

I've already fixed that, now it works ok. diffs attached

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mdisegfault.diff
Type: text/x-diff
Size: 1333 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20080302/aaf45bd3/attachment.bin>

Reply by email

Paul Ishenin
to zeljko
zeljko wrote
I've already fixed that, now it works ok. diffs attached

You like workarounds :) Please attach small demo then we can find better solution.

Best regards,
Paul Ishenin.

Reply by email

zeljko
to Paul Ishenin
Paul Ishenin wrote 5 lines
zeljko wrote: > I've already fixed that, now it works ok. diffs attached You like workarounds :) Please attach small demo then we can find better solution.

I think that's not a workaround since workspace is managing mdi children, anyway small app is attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testmdi.zip
Type: application/x-zip
Size: 4824 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20080302/562a4ab2/attachment.bin>

Reply by email

Paul Ishenin
to zeljko
zeljko wrote 13 lines
On Sunday 02 March 2008 10:18, Paul Ishenin wrote: > zeljko wrote: > >> I've already fixed that, now it works ok. diffs attached >> > You like workarounds :) Please attach small demo then we can find better > solution. > I think that's not a workaround since workspace is managing mdi children, anyway small app is attached.

It enters endless loop due to missed implementation for MDI inside LCL. This should be fixed on LCL level.

Best regards,
Paul Ishenin.

Reply by email

zeljko
to Paul Ishenin
Paul Ishenin wrote 13 lines
zeljko wrote: > On Sunday 02 March 2008 10:18, Paul Ishenin wrote: >> zeljko wrote: >>> I've already fixed that, now it works ok. diffs attached >> >> You like workarounds :) Please attach small demo then we can find better >> solution. > > I think that's not a workaround since workspace is managing mdi children, > anyway small app is attached. It enters endless loop due to missed implementation for MDI inside LCL. This should be fixed on LCL level.

so, workaround is ok for now ? ;)

Reply by email

Paul Ishenin
to zeljko
zeljko wrote 6 lines
> It enters endless loop due to missed implementation for MDI inside LCL. > This should be fixed on LCL level. > so, workaround is ok for now ? ;)

Maybe. I dont know a reason why focus jumps back to form when we call setFocus for edit control. If you know please tell me then we can fix this reason. In other case we should use your solution.

Best regards,
Paul Ishenin.

Reply by email

zeljko
to Paul Ishenin
Paul Ishenin wrote 9 lines
zeljko wrote: >> It enters endless loop due to missed implementation for MDI inside LCL. >> This should be fixed on LCL level. > > so, workaround is ok for now ? ;) Maybe. I dont know a reason why focus jumps back to form when we call setFocus for edit control. If you know please tell me then we can fix this reason. In other case we should use your solution.

I think it's because of workspace (it manages children windows) (Application<->MainForm<->Workspace<->MDIChild<->). I know that my patch is workaround, but as I can see it breaks nothing, MDIChilds are focused properly ... (workspace is doing this). As you said before, problem is in missing LCL implementation, so we can sign it as workaround until better times for MDI comes :)

Shoud I commit ?

Show quoted text 6 lines
Best regards, Paul Ishenin. _______________________________________________ Qt mailing list http://www.lazarus.freepascal.org/mailman/listinfo/qt

Reply by email

Paul Ishenin
to zeljko
zeljko wrote 9 lines
I think it's because of workspace (it manages children windows) (Application<->MainForm<->Workspace<->MDIChild<->). I know that my patch is workaround, but as I can see it breaks nothing, MDIChilds are focused properly ... (workspace is doing this). As you said before, problem is in missing LCL implementation, so we can sign it as workaround until better times for MDI comes :) Shoud I commit ?

yes.

Reply by email

zeljko
to Paul Ishenin
Paul Ishenin wrote 11 lines
zeljko wrote: > I think it's because of workspace (it manages children windows) > (Application<->MainForm<->Workspace<->MDIChild<->). > I know that my patch is workaround, but as I can see it breaks nothing, > MDIChilds are focused properly ... (workspace is doing this). > As you said before, problem is in missing LCL implementation, so we can > sign it as workaround until better times for MDI comes :) > > Shoud I commit ? yes.

Done.
Have you look at #10880 (invisible scrollbars on MacOsX) ?

Show quoted text 5 lines
_______________________________________________ Qt mailing list http://www.lazarus.freepascal.org/mailman/listinfo/qt

Reply by email

Paul Ishenin
to zeljko
zeljko wrote 18 lines
On Sunday 02 March 2008 11:37, Paul Ishenin wrote: > zeljko wrote: > >> I think it's because of workspace (it manages children windows) >> (Application<->MainForm<->Workspace<->MDIChild<->). >> I know that my patch is workaround, but as I can see it breaks nothing, >> MDIChilds are focused properly ... (workspace is doing this). >> As you said before, problem is in missing LCL implementation, so we can >> sign it as workaround until better times for MDI comes :) >> >> Shoud I commit ? >> > yes. > Done.

I have tried to improve it a bit.

Have you look at #10880 (invisible scrollbars on MacOsX) ?

No, I dont have a real Mac. Maybe I next month I will.

Best regards,
Paul Ishenin.

Reply by email

zeljko
to Paul Ishenin
Paul Ishenin wrote 21 lines
zeljko wrote: > On Sunday 02 March 2008 11:37, Paul Ishenin wrote: >> zeljko wrote: >>> I think it's because of workspace (it manages children windows) >>> (Application<->MainForm<->Workspace<->MDIChild<->). >>> I know that my patch is workaround, but as I can see it breaks nothing, >>> MDIChilds are focused properly ... (workspace is doing this). >>> As you said before, problem is in missing LCL implementation, so we can >>> sign it as workaround until better times for MDI comes :) >>> >>> Shoud I commit ? >> >> yes. > > Done. I have tried to improve it a bit. > Have you look at #10880 (invisible scrollbars on MacOsX) ? No, I dont have a real Mac. Maybe I next month I will.

ok, I've checked all code twice (your changes with scrollbar), but didn't found anything what can cause such silly behaviour of scrollbars under mac. Native qt4 scrollbars works ok.

Reply by email