Backstory:I usually avoid Pointers like the plague, and so I am very inexperienced using them. I am currently threading a class, and it is complaining when I have a QProcess on the stack because Cannot create children for a parent that is in a different thread. These errors go away when I place them on the heap, so that is what I am trying.Question:What is the proper way to delete and deallocate this process?My first thought was to set the parent as the class(this) it belonged to:    QEventLoop skuEvent;    m_QuerySku = new QProcess(this); // m_QuerySku is a pointer.     connect(m_QuerySku, SIGNAL(readyRead()), this, SLOT(querySku()));    connect(this, SIGNAL(queriedSku()), &skuEvent, SLOT(quit()));    m_QuerySku->start(ssh, sl);    skuEvent.exec();    disconnect(m_QuerySku, SIGNAL(finished(int)), this, SLOT(querySku()));    disconnect(this, SIGNAL(queriedSku()), &skuEvent, SLOT(quit()));    // Presumably gets deleted when the class it belongs to goes out of scope.I asked in ##C++ on IRC; someone suggested this:if m_QuerySku is a pointer then that will be deleted when out of scope, however QProcess will still be allocated if you run delete m_QuerySku; it will just delete QProcess allocation, the pointer will stay and I'd recommend setting it to nullptr.Which I interpret as this:    QEventLoop skuEvent;    m_QuerySku = new QProcess();     connect(m_QuerySku, SIGNAL(readyRead()), this, SLOT(querySku()));    connect(this, SIGNAL(queriedSku()), &skuEvent, SLOT(quit()));    m_QuerySku->start(ssh, sl);    skuEvent.exec();    disconnect(m_QuerySku, SIGNAL(finished(int)), this, SLOT(querySku()));    disconnect(this, SIGNAL(queriedSku()), &skuEvent, SLOT(quit()));    m_QuerySku.close();    delete m_QuerySku;     m_QuerySku = nullptr;Are both safe methods?Does the latter violate any Qt style guidelines, or is it fine to do it this way?Thanks.
What is the proper way to delete a QProcess Pointer?
c++;coding style;coding standards;pointers;qt