Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Export On-Screen Data to XML
QtWS25 Last Chance

Export On-Screen Data to XML

Scheduled Pinned Locked Moved General and Desktop
24 Posts 4 Posters 11.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pmcfrack
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      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.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pmcfrack
        wrote on last edited by
        #3

        Essentially yes, however, I only need the text or value property of the widget. So essentially the data that the end user would be able to modify. Text in text boxes, values in drop downs, True/False in check boxes, etc.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          QMetaObject provides a way to retreive that property. This property is called the USER property, and will be marked as such for well behaved widgets. See QMetaObject::userProperty().

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pmcfrack
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • G Offline
                G Offline
                giesbert
                wrote on last edited by
                #7

                not afaik.

                have you googled for it?

                Nokia Certified Qt Specialist.
                Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  giesbert
                  wrote on last edited by
                  #8

                  So,

                  what is possible is using the property widget (is that part of QtDesigner, QtCreator). There was a QtSolution with that.

                  Nokia Certified Qt Specialist.
                  Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZapB
                    wrote on last edited by
                    #9

                    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.

                    Nokia Certified Qt Specialist
                    Interested in hearing about Qt related work

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andre
                      wrote on last edited by
                      #10

                      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 :-)

                      1 Reply Last reply
                      0
                      • Z Offline
                        Z Offline
                        ZapB
                        wrote on last edited by
                        #11

                        Yes if it is linked dynamically you could provide a modified Qt that has the necessary operators and then calls them at a suitable time (when Ok on the dialog is clicked for e.g.).

                        Nokia Certified Qt Specialist
                        Interested in hearing about Qt related work

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          andre
                          wrote on last edited by
                          #12

                          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.

                          1 Reply Last reply
                          0
                          • Z Offline
                            Z Offline
                            ZapB
                            wrote on last edited by
                            #13

                            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.

                            Nokia Certified Qt Specialist
                            Interested in hearing about Qt related work

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              andre
                              wrote on last edited by
                              #14

                              [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 :)

                              1 Reply Last reply
                              0
                              • P Offline
                                P Offline
                                pmcfrack
                                wrote on last edited by
                                #15

                                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.

                                1 Reply Last reply
                                0
                                • G Offline
                                  G Offline
                                  giesbert
                                  wrote on last edited by
                                  #16

                                  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!

                                  Nokia Certified Qt Specialist.
                                  Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                                  1 Reply Last reply
                                  0
                                  • P Offline
                                    P Offline
                                    pmcfrack
                                    wrote on last edited by
                                    #17

                                    We don't have control over the executable. Do you know of a simple way to determine whether or not MSAA is enable, short of writing an app to try it?

                                    1 Reply Last reply
                                    0
                                    • G Offline
                                      G Offline
                                      giesbert
                                      wrote on last edited by
                                      #18

                                      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

                                      Nokia Certified Qt Specialist.
                                      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                                      1 Reply Last reply
                                      0
                                      • A Offline
                                        A Offline
                                        andre
                                        wrote on last edited by
                                        #19

                                        I still think the adapted Qt version or plugin aproach is feasable.

                                        1 Reply Last reply
                                        0
                                        • G Offline
                                          G Offline
                                          giesbert
                                          wrote on last edited by
                                          #20

                                          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):

                                          1. 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)
                                          2. 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...

                                          Nokia Certified Qt Specialist.
                                          Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved