Results 1 to 2 of 2

Thread: how to insert item from XML file using readElementText to tablewidget

  1. #1
    Join Date
    Oct 2010
    Posts
    6
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to insert item from XML file using readElementText to tablewidget

    hi everybody
    i try to code an example to read messages in qt designer. i searched in google but allmost is example for symbian and a don't understand it.
    After grope in example of qt designer and i want to save all message in xml file with format
    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <Example>
    3. <MESS1>
    4. <Content>123456789A 123456789B 123456789C 123456789D 123456789E 123456789F 123456789G 123456789H</Content>
    5. <From>Admin</From>
    6. <Time>25</Time>
    7. </MESS1>
    8. <MESS2>
    9. <Content>noi dung 2</Content>
    10. <From>Guess</From>
    11. <Time>20</Time>
    12. </MESS2>
    13. <MESS3>
    14. <Content>noi dung 3</Content>
    15. <From>Guess</From>
    16. <Time>20</Time>
    17. </MESS3>
    18. ........
    19. </Example>
    To copy to clipboard, switch view to plain text mode 

    and i used Qxmlstreamreader element to read content in xml file
    but i don't know to display it to tablewidget
    i want to make a simple example to read messages as inbox message in mobile .
    when i run it all data will display in table widget with two column : From and Short content
    like this

    somebody help me One of the replies has an attachment with an example project for this problem

    i just want to display data from xml file to tablewidget with 2 column and when i click in one row i can see the content of it.

    A big thanks for everyone
    regards
    Newbie

  2. #2
    Join Date
    Oct 2010
    Posts
    6
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to insert item from XML file using readElementText to tablewidget

    Qt Code:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <Example>
    3. <MESS1>
    4. <Content>123456789A 123456789B 123456789C 123456789D 123456789E 123456789F 123456789G 123456789H</Content>
    5. <From>Admin</From>
    6. <Time>25</Time>
    7. </MESS1>
    8. <MESS2>
    9. <Content>noi dung 2</Content>
    10. <From>Guess</From>
    11. <Time>20</Time>
    12. </MESS2>
    13. <MESS3>
    14. <Content>noi dung 3</Content>
    15. <From>Guess</From>
    16. <Time>20</Time>
    17. </MESS3>
    18. <MESSn>
    19. </Example>
    To copy to clipboard, switch view to plain text mode 
    one small questions when waiting for the first post , please help me.
    how to count n mess from xml file with this format :-S
    in symbian i found
    for(int i = 0; i < messageIdList.count(); ++i)
    to count idlist but in qt creator i don't know

Similar Threads

  1. Replies: 4
    Last Post: 11th October 2014, 14:21
  2. how to insert items in tableWidget
    By roncriss in forum Newbie
    Replies: 3
    Last Post: 24th July 2010, 17:10
  3. Insert parent item in proxy model
    By geflei in forum Newbie
    Replies: 0
    Last Post: 9th May 2010, 16:15
  4. Insert an item in an horizontal QListWidget
    By satoshi in forum Qt Programming
    Replies: 8
    Last Post: 19th May 2009, 17:33
  5. insert Item to my QTreeWidget
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 28th February 2006, 15:42

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.