Hi anda_skoa, you seem to be the one who most often gives advice, thank you.
In another class I have the following where I instantiate this error logging class, along with a test of the logError method.
After this, I only close the application, believing[/hoping!] that all destructors then get called automatically.
m_ErrorLog = new ErrorLogging;
m_ErrorLog->logError("1", "2", "3");
m_ErrorLog = new ErrorLogging;
m_ErrorLog->logError("1", "2", "3");
To copy to clipboard, switch view to plain text mode
Also, would this be the new destructor then, in order to delete the m_File variable?
ErrorLogging::~ErrorLogging()
{
logStream << "File closing...\n";
m_File->close();
delete m_File;
}
ErrorLogging::~ErrorLogging()
{
QTextStream logStream(m_File);
logStream << "File closing...\n";
m_File->close();
delete m_File;
}
To copy to clipboard, switch view to plain text mode
I declare m_File as
private:
private:
QFile *m_File;
To copy to clipboard, switch view to plain text mode
Bookmarks