 This section is going to be a bit easier compared to what we've covered so far. What we're going to cover next are called algorithms So let's go ahead and include Q debug let's include Q list and We're going to include Qt algorithms Notice how it's Qt not cute This should Quoty fingers should be included by default, but sometimes on some systems you may actually have to include this What we're going to cover in this specific video is A I think it's a macro called Q delete all And its use case is dead simple, but it's extremely helpful Let's say we have a class and there's absolutely nothing in this class. I just created it just to say hey We have a class But what we're going to do is we're going to create a Q list of Pointers to that class Probably help if I did the include for it and just give this the ever descriptive name of list This is a pretty common programming scenario. We're going to have a list of pointers and we've just got a simple Simple piece of code that's just going to create some pointers here Notice there's no parent meaning we're just going to create a free-floating pointer out on the heap This could get pretty nasty pretty bad. All right, so let's say set object name So what typically happens? Well, we run the application Everything runs as expected and then we close it and we're relying on the operating system to free up that memory Which may or may not actually happen? So let's just queue info some stuff out here Typically what we would do is we would say Set a parent or some other memory management Technique, but let's just say for the sake of argument. We can't do that for some reason So in this case, we're just going to say queue delete all and give it the list What this is going to do is just go through that entire list It's the same thing as doing a for loop, but it puts it in this nice neat one liner It's gonna just delete everything notice how We can still access that list Go ahead and save and run and let's demonstrate this You notice how it actually killed our program because we're trying to access an invalid pointer What I'm demonstrating here is that queue delete all will delete the pointers, but not the objects out of the list So the correct way to do this would be to actually clear it out And let's go ahead and comment that out That way if somebody tries to download and run this they're not wondering why the application is crashing So super short queue delete all just takes a list Deletes all the pointers out of the list, but it's up to you to clear those actual objects out of the list If you try to access one it will crash your program But it's a super simple little macro that lets you just clear out the memory I hope you enjoyed this video. It's part of a video series I have out on you to me calm This particular video is a follow-on in the intermediate course, but you can start in queue core for beginners And if we just kind of crack this open It's got a lot of content that'll take you from an absolute beginner that just knows absolutely nothing from hello world all the way up to What are templates generics air handling in classes? This specific video is part of the cute core intermediate class This picks right up where the beginners course left off and we do things like memory management collections Working with settings the file system a lot of file system compression serialization and much much more