i want to use unique_ptr for a QMenu without making it as a child of the base widget so i have declared it like this
private:
std::unique_ptr<QMenu> m_pMenu;
and in constructor
std::unique_ptr<QMenu> m_pMenu ( new QMenu());
m_pMenu->setObjectName("JobContextMenu");
i also added CONFIG += c++11 in my .pro file but when compiling the unique_ptr is returning an error as Invalid application of 'sizeof' to an incomplete type 'QMenu'
Duplicate definition. Also, you can do it in such way in C++ 11: