Results 1 to 3 of 3

Thread: QDOMLite - Light weight DOM/XML

  1. #1
    Join Date
    Jul 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default QDOMLite - Light weight DOM/XML

    QDOMLite.h. Quick and Dirty Document Object Model. Fast and low-resource one-file XML.

    in your .pro:
    Qt Code:
    1. CONFIG += c++11
    2. DEFINES += QT_USE_QSTRINGBUILDER
    To copy to clipboard, switch view to plain text mode 

    Parse:
    Qt Code:
    1. QTreeWidgetItem* i = new QTreeWidgetItem({"Document"});
    2. ui->treeWidget->addTopLevelItem(i);
    3. QDomLiteDocument d(”yourfile.xml");
    4. parseElement(d.documentElement,i);
    5.  
    6. void parseElement(QDomLiteElement* e, QTreeWidgetItem* i)
    7. {
    8. for (QDomLiteElement* c : e->childElements) parseElement(c,new QTreeWidgetItem(i,{c->tag}));
    9. }
    To copy to clipboard, switch view to plain text mode 

    File:

    https://www.dropbox.com/s/7q39f1y31g...domlite.h?dl=0

  2. #2
    Join Date
    Sep 2018
    Location
    China
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: QDOMLite - Light weight DOM/XML

    nice job.

  3. The following user says thank you to rekols for this useful post:

    vemod (7th December 2018)

  4. #3
    Join Date
    Jul 2011
    Posts
    2
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Update

    File has now been updated (still same link).

    QRegExp has been replaced with QRegularExpression. The fromString function now has some clever look-ahead and passes smaller substrings when recursing.

    Performance has been improved considerably, up to 100 times for really large files. Have fun!

Similar Threads

  1. Qml font.weight not working?
    By ecspertiza in forum Qt Quick
    Replies: 4
    Last Post: 16th March 2017, 12:33
  2. High light do not upate?
    By Abel in forum Qt Quick
    Replies: 6
    Last Post: 5th November 2014, 08:57
  3. qt4 with light blinking on device
    By khcbabu in forum Qt Programming
    Replies: 1
    Last Post: 9th March 2009, 15:52
  4. Light items for the graphicsView
    By maverick_pol in forum Qt Programming
    Replies: 12
    Last Post: 1st November 2007, 18:51

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.