The new QString call here will result in a memory leak (there's no corresponding delete call here and nothing is given ownership of the pointer to free it later). In this case, you can just replace *new QString("File to attach") with "File to attach". The compiler will automatically called the QString constructor on the string (same as if you had typed QString("File to attach").