- Do away with nested Private classes, ClassFoo::Private and replace itthem with ClassFooPrivate, this aligns with what Qt upstream is using, and what the newer classes in KF is using. And it also means we wouldn't need to use Q_DECLARE_PRIVATE for the nested Private class, and removes the risk of forgetting to use Q_DECLARE_PRIVATE and having the private symbols exported[1]
- Use a smart pointer to manage the d-pointer, std::unique_ptr (or one of Qt's, e.g. QScopedPointer), instead of calling delete manually in the class's destructor.
- The d-pointer would be forward declared in the header, and what the newer classes in KF is usingwith d declared as a private member in the class:
```
private:
std::unique_ptr<ClassFooPrivate> d;
```
And ClassFooPrivate would have a q pointer member:
```
ClassFoo *const q
- Use a smart pointer to manage```
This way one can use d->bar() or q->baz() without the d-pointer,need for Q_Q and Q_D macros. std::unique_ptr (or one of Qt's)Those macros are still useful for classes where the Private class of the sub-class inherits from the one in the base class, instead of calling delete manually in the class's destructorsee https://phabricator.kde.org/T13924#246220 for details.
(Personally I am in favour of unique_ptr).[1] https://mail.kde.org/pipermail/kde-frameworks-devel/2015-August/025956.html