Results 1 to 15 of 15

Thread: Reading and rereading a file with QXmlStreamReader

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 66 Times in 62 Posts

    Default Re: Reading and rereading a file with QXmlStreamReader

    Quote Originally Posted by lni View Post
    In java, you could add "final" keyword so no one can derive from A, but in C++ there is no such keyword...I guess this is one of C++'s weakness...
    if you keep a destructor of a class as private, most compilers would not let that class be subclassed..at least thats how Stroustrup intended it, some compilers seem to have ignored that..but all GNU compilers would not let you subclass a class with private destructor..so its no weakness of C++..anything that java can do, c++ can do it on one leg with high heels..with less memory consumption

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Reading and rereading a file with QXmlStreamReader

    Quote Originally Posted by talk2amulya View Post
    anything that java can do, c++ can do it on one leg with high heels..with less memory consumption
    Except for proper exception handling
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2006
    Posts
    426
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    8
    Thanked 18 Times in 17 Posts

    Default Re: Reading and rereading a file with QXmlStreamReader

    Quote Originally Posted by talk2amulya View Post
    if you keep a destructor of a class as private, most compilers would not let that class be subclassed..at least thats how Stroustrup intended it, some compilers seem to have ignored that..but all GNU compilers would not let you subclass a class with private destructor..so its no weakness of C++..anything that java can do, c++ can do it on one leg with high heels..with less memory consumption
    How do you delete the object if the dtor is private? You will have to provide a public "release" method to call when you want to delete it, and you won't be able to create an object on stack with private dtor...

    For a class without virtual dtor, the object will have no vtable, you won't gain anything to use "IsA" relationship. I would use "hasA" relationship to be more intuitive and avoid possible memory leak. Again, C++ don't stop you from deriving from it....

  4. #4
    Join Date
    Apr 2015
    Posts
    1
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Reading and rereading a file with QXmlStreamReader

    Qt Code:
    1. void QXmlStreamReader::setDevice(QIODevice * device)
    To copy to clipboard, switch view to plain text mode 

    Sets the current device to device. Setting the device resets the stream to its initial state.

    See also device() and clear().
    http://doc.qt.io/qt-4.8/qxmlstreamre...l#namespaceUri

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.