Export On-Screen Data to XML
-
Are there existing add-ons or plugins that will take on-screen data and export it to an XML file on the client computer? Essentially we have a client application developed on the qt framework and are looking for a way to export the data held in the on-screen controls to an XML file. This could be initiated by data change on screen or by some end user event. Thanks and please ask questions!
-
you want a way to export all data of all widgets inside this app to xml?
then iterate all QObjects (or QWidgets) including they children and write all properties (can be received via the QMetaObject system) to XML.I know no way to do this now without doing it on your own.
-
I guess my question is more along the lines of, are there distributable plugins / add-ons that have this type of functionality already built? I am not looking to develop the solution myself, however, before going the route of consulting with a Qt developer, I wanted to inquire if this is something that is already out there.
-
I don't know of any out there, but I can imagine how you could make such a thing... The only thing I know that comes close, is Froglogic's squid. I don't know how they interact with the running application, but they do manage to interact with it for automatic GUI testing.
-
I do not know of any existing solution but should be fairly simple to implement. You just need to provide operators of the form:
@QXmlStreamWriter* operator << ( QXmlStreamWriter& writer, QWidget* w );@
In the implementation you should use QXmlStreamWriter to output the user property and then iterate over its child QWidgets and call the operator on each of those in turn.
-
I understand however, that pmcfrack would like to do this without adapting the original Qt program, or did I misunderstand that? I still think that should be possible (if the app is linked dynamically), but a bit more tricky. Sounds like a nice challange :-)
-
Or, you create a Qt plugin that provides this service, perhaps in the form of a custom proxy style or something like that. However, a modified Qt lib (altered QApplication, I think would be my first vector of attack) would work just as well or better, I guess.
-
[quote author="ZapB" date="1300010321"]Agreed. Taking it one step further, you could provide a modified QApplication that listens on a tcp socket and serialises all visible widgets (or some subset) upon receiving a suitable network request...or any other input along these lines.[/quote]
My thoughts exactly :)
-
The reason that I am looking for a way to export data from widgets to XML, is that we are no longer able to get a text from widgets using WM_GETTEXT. Keep in mind this is a 3rd party application that we have no control over. So, this thread was started as more of a method of working around the issue. Hope that helps clarify the issue.
-
Do you have control over the executable? If not, it get' really interesting...
You could use MSAA to access the data, if the third party app enabled MSAA. This was something that was already proposed to you in your "other thread":http://developer.qt.nokia.com/forums/viewthread/1967/
There is no way to just call get text on a widget where you are not part of the process and have not object pointers!
-
Have you read my answers on the other thread?
[quote author="Gerolf" date="1290874030"]You have no chance to get the text out of third party. Only if it supoports MSAA (Microsoft Active Accessibility). That's what I told you some posts up. But as you suggested to use Pointer(Of QWidget) = QWidget.find(DirectCast(hwnd..., I said that those classes are only for C++.
But from outside of the process, it's getting difficult. For "normal" Win32 windows classes there are possibilities, but QWidgets do not depend on "normal" Win32 window types.So, again: try out using MSAA (search "http://msdn.microsoft.com":http://msdn.microsoft.com for it).
For examples on how to program that, you can also look at: "http://www.codeproject.com/KB/winsdk/MSAA_UI_Automation.aspx":http://www.codeproject.com/KB/winsdk/MSAA_UI_Automation.aspx[/quote]
You can use google for tools to check MSAA and also tools to read values via MSAA. Microsoft supports them, e.g. search for: AccExplorer32.exe
-
If you have no control over the app code, you can't adopt it (or use an adopted Qt). That's exactly the point. We saom similar discussion with our system test, as they need some similar features.
There are tqo ways (from my point of view):
- Use Squish, but then you need to create some extra stuff that needs to be build while building your application (or you needed it in earlier versions, I don't know the newest ones)
- Use MSAA, but to use it, the MSAA pluginb needs to be used from the application. Not sure if it is automatically used when it is placed in the correct plugin folder...