[Qt-interest] When using Qt, pressing an item on the toolbar control causes the main application window to lose focus.

Chance Yohman chance.yohman at gmail.com
Mon Mar 7 18:48:54 CET 2011


I realize the Qt community can not easily assist me. I have submitted a
support request to ESRI and the Trolls. What I was wondering is has anyone
programmed an application where they were using a QWidget to load an ActiveX
control and when they pressed on the QWidget that had loaded the ActiveX
control the main application window (a QMainWindow) lost focus.
Programmatically, is there a way to return focus to the main window? Thanks
in advance.

Please refer to:
http://forums.arcgis.com/threads/25169-Focus-Problems-with-ArcObjects-Cross-Platform-C-SDK?p=82978#post82978

Focus Problems with ArcObjects Cross-Platform C++ SDK

Target Environment Development OS: 64-bit Windows 7 Deployed OS: 32-bit
Windows XP Toolkit: Qt 4.7.1

In the next three videos, please note the issue. At start-up, a user can
hover across the toolbar and it brings up the tool tip for each
command/tool. When a user presses a command/tool the main application window
loses focus. If the user hovers across the toolbar now, there are no
tooltips- obviously. If the user subsequently clicks commands, then they
appear raised and tooltips still do not work while the main application
window does not have focus. Tools function properly other than no tooltips.

If the video is too small, then please run it full-screen.

*Qt4 Toolkit *
http://www.youtube.com/watch?v=VjzotLGo2UM&feature=player_embedded

*WxWidgets Toolkit *
http://www.youtube.com/watch?v=3zO-jo2CfpY&feature=player_embedded

*GTK Toolkit *
http://www.youtube.com/watch?v=3xyWjVNp6rk&feature=player_embedded

*Please note*: The Visual C++ SDK behaves normally. The main window does not
lose focus. The delay when I click Fixed Zoom-In is from labeling.
http://www.youtube.com/watch?v=dg4UjE77R-I&feature=player_embedded

My question is, for the Qt example, how do I get the focus to return to the
main window after clicking an item on the toolbar? I suppose I could use the
IToolbarControlEvents interface to capture one of the mouse actions, but how
would I return the focus to the main window? Would I pass the QMainWindow
into the IToolbarControlEvents implementation constructor or access it
through the QAxCtl through the IToolbarControl interface(how?) and then
accessing the QMainWindow through QAxCtl through accessing parent widgets
(provided they had been set) until I reached the top level?

Thanks in advance.

If you have ArcObjects Cross Platform C++ or/and Visual C++ (.NET) SDK(s)
installed, the example are:

1) \ArcGIS\DeveloperKit10.0\Samples\ArcObjectsCPP\DynamicDisplay\Qt_Cpp
2)\ArcGIS\DeveloperKit10.0\Samples\ArcObjectsCPP\MapTocToolbar\Wx_Cpp
3)\ArcGIS\DeveloperKit10.0\Samples\ArcObjectsCPP\MapTocToolbar\GTK_Cpp
4)
\ArcGIS\DeveloperKit10.0\Samples\ArcObjectsVCPP\geodesy_map_control_sample\Visual_CPP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110307/bb09de9e/attachment.html 


More information about the Qt-interest-old mailing list