Splitting QString on spaces and keeping the space in QList – best or 'canonical' way

As in the title, I would like to ask what is the best way to split a QString on spaces and – where relevant – keep the spaces as parts of the resulting QList elements. I’m interested in the most efficient method of doing this, considering modern C++ and Qt >= 6.0 paradigms. For the… Read More Splitting QString on spaces and keeping the space in QList – best or 'canonical' way

Couldn't free allocated memory using delete

I’m allocating memory in a member function like below: void Wrapper::PutData() { mpeople.append(new people("ALPHA","BEETA","GAMMA", this)); mpeople.append(new people("ALPHA","BEETA","GAMMA", this)); mpeople.append(new people("ALPHA","BEETA","GAMMA", this)); } where the mpeople object is declared as QList<QObject*> mpeople; Everything works fine until i try to remove items using the below member-function void Wrapper::RemoveClient(int index){ if(index >= 0){ delete[] mpeople[index]; mpeople.removeAt(index); } resetModel();… Read More Couldn't free allocated memory using delete