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

Malyushytsky, Alex alex at wai.com
Tue Mar 8 23:11:59 CET 2011


>>Please note: The Visual C++ SDK behaves normally.

"The Visual C++ SDK" example design is different from other examples -  No dialogs are opened and NO other widgets get focus.
Design other examples the same way and you will have similar results.

Alex


From: qt-interest-bounces+alex=wai.com at qt.nokia.com [mailto:qt-interest-bounces+alex=wai.com at qt.nokia.com] On Behalf Of Chance Yohman
Sent: Monday, March 07, 2011 9:49 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] When using Qt, pressing an item on the toolbar control causes the main application window to lose focus.

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


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110308/a42833e8/attachment.html 


More information about the Qt-interest-old mailing list