Results 1 to 12 of 12

Thread: when will be QSharedFromThis for QSharedPointer?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: when will be QSharedFromThis for QSharedPointer?

    But without this functional - Qt shared pointer mechanizm is no full - it's not useful!!
    That's a bit like saying the C++ standard library is not useful because it does not have a "shared_from_this" mechanism either. Clearly that's why Boost implemented the functionality. You can use the Boost shared_ptr/weak and shared_from_this with a program that also uses Qt, so I'm not sure where the real problem is here.

  2. #2
    Join Date
    Nov 2012
    Posts
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: when will be QSharedFromThis for QSharedPointer?

    Quote Originally Posted by ChrisW67 View Post
    That's a bit like saying the C++ standard library is not useful because it does not have a "shared_from_this" mechanism either.
    Fun ) C++ standard library have "shared_from_this" mechanism
    http://en.cppreference.com/w/cpp/mem...ared_from_this


    Clearly that's why Boost implemented the functionality. You can use the Boost shared_ptr/weak and shared_from_this with a program that also uses Qt, so I'm not sure where the real problem is here.
    Yes it was written in this way(boost + Qt) but I don't like code style mixing, so I rewrote it in clear Qt, because Qt no uses default c/c++ code style like in stl or
    boost. It's difficult to support projects with multiple codestyles - it's very bad practice.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: when will be QSharedFromThis for QSharedPointer?

    Quote Originally Posted by fsmoke View Post
    Fun ) C++ standard library have "shared_from_this" mechanism
    ... since C++11, and still not universally available. So ultimately you don't even need a third-party extension to C++ if you have a suitably equipped tool chain. Prior to that of course C++ was useless and nobody ever wrote anything of value in C++

Similar Threads

  1. QSharedPointer with signals and slots
    By xtal256 in forum Qt Programming
    Replies: 20
    Last Post: 7th July 2012, 04:34
  2. QSharedPointer / QWeakPointer in QML?
    By centipede in forum Qt Quick
    Replies: 1
    Last Post: 23rd May 2012, 09:25
  3. emitting QSharedPointer
    By babu198649 in forum Newbie
    Replies: 11
    Last Post: 26th July 2010, 08:51
  4. Problem with QSharedPointer
    By weaver4 in forum Newbie
    Replies: 2
    Last Post: 19th April 2010, 14:22
  5. QSharedPointer vs Boost::tr1::shared_ptr()
    By photo_tom in forum Qt Programming
    Replies: 1
    Last Post: 11th March 2010, 16:48

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.