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
    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....

  2. #2
    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.