Results 1 to 15 of 15

Thread: XML to QML converter

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    10
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default XML to QML converter

    Hello all,

    I am working on a project which I use QML to draw my GUI. But somehow I need to generate QML files from XML based solution like this;

    Qt Code:
    1. <general>
    2. <text name="src_text1" value="this is text 1" />
    3. <text name="src_text2" value="this is text 2" />
    4. <image name="src_image1" location="/opt/cutekit/data/images/qt.png">
    5. <!-- many more slots to come! -->
    6. </general>
    To copy to clipboard, switch view to plain text mode 

    to;

    Qt Code:
    1. Rectangle {
    2. width: 1920
    3. height: 1080
    4. color: "#00000000"
    5.  
    6. Text {
    7. id: text1
    8. x: 252
    9. y: 574
    10. width: 80
    11. height: 20
    12. text: src_text1
    13. font.pixelSize: 12
    14. opacity: 0
    15. }
    16.  
    17. Text {
    18. id: text2
    19. x: 492
    20. y: 574
    21. width: 80
    22. height: 20
    23. text: src_text2
    24. font.pixelSize: 12
    25. opacity: 0
    26. }
    27.  
    28. Image {
    29. id: image1
    30. x: 772
    31. y: 297
    32. width: 100
    33. height: 100
    34. source: src_image1
    35. opacity: 0
    36. }
    37. }
    To copy to clipboard, switch view to plain text mode 


    So my question is, do I have to do this manually on runtime(parsing xml, creating qml file), or is there any tool to help me on this one?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: XML to QML converter

    What is the use of expressing QML in XML?
    Why not use QML directly?
    What are you trying to achieve?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. PDF to Image Converter
    By RajabNatshah in forum Qt Programming
    Replies: 16
    Last Post: 23rd May 2024, 07:03
  2. Unit Converter Widget
    By baray98 in forum Qt Programming
    Replies: 13
    Last Post: 17th December 2016, 16:06
  3. Please help. Converter Dec to bin and Hex
    By Novice in forum Newbie
    Replies: 4
    Last Post: 29th March 2011, 10:41
  4. QTest to NUnit, MBUnit or MSTest format xml converter
    By ralphing in forum Qt Programming
    Replies: 1
    Last Post: 7th September 2010, 09:16
  5. Image Converter
    By deekayt in forum General Discussion
    Replies: 1
    Last Post: 30th October 2006, 21:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.