 Hey everybody, this is Brian. Welcome to the 125th. Wow, we're flying through these things. Every time I think I can't do another Qt tutorial, there's always a subject. Alright, so we're going to be discussing the Qt concurrency filter. And this is actually a little bit different than what you're used to here, so bear with me. We're going to, whoops, not a widget, Dialog. And we're going to keep these graphically very similar, so you're not kind of thrown off by the way it looks. And we're going to make, you know, a couple list widgets here. It is Christmas Eve, so Merry Christmas everybody. Alright, so we got our snazzy super awesome user interface here. And we're just going to go to slot clicked. Let's actually go back here, close that bad boy. Now, we want to, before we really get into this, add our concurrency. I always get a little bit ahead of myself. I get so excited to do these tutorials. And it's like, sometimes I feel very stupid because I feel like I know it. And then when I go to actually explain it, I realize I can't explain it as good as I thought I could. Alright, so filter. What's the point of a filter? We've talked about mapped. Mapping is when you map a function to a specific item in a sequence. Well, filter is similar, but you're going to filter out items from the sequence. So we're going to make a static bool. We're going to call it do filter. Whoopsie. Const. Queestring and we're going to call it name. Notice how we've got the constant queue string name because we don't want to modify this thing. Similar structure to all our other programs. We're going to, you know, have a function that gets called and then we got a push button that does the meat of the project here. So what we want to do here is actually just say if name. To lower. Equals, say Bob, we're going to pick on Bob. Return false. Otherwise we're just going to return true. So when we're filtering, we're going to filter a list of names here. If it's Bob, we don't want it to be allowed. Otherwise we want it to be allowed. So we'll call this queue string list. People, we're just going to say people. And we're just going to add some names here. Chad, Mary. I was having a hard time coming up with names. Bob's got to be in the list because we're trying to use him as an example here. And why not Heather? So that is our list that we're going to filter. Now we're going to queue concurrent. Blocking filter. Pretty similar. You need a sequence and then a keep functor, which is just a function pointer basically. Our sequence of course is people. And our functor of course is going to be dialogue. Do filter. Now we're going to actually just update some lists here. So it's kind of back up. And let's say, actually let's not back up. Let's live dangerously and move forward. UI, list widget clear. UI, list widget to clear. And then we're just going to update these UI. Actually, we can't, we got to do it up here. Like I said, long day. Work has just been sucking the life out of me. There we go. So right here we're going to say UI, list widget, add items. I was actually thinking about our next tutorial, which is the filtered, which if you've been following along, I'm sure you know what filtered is going to actually do. All right. So the first one is going to be just, you know, what the list is. And the second one is going to be the modified version of that list. Alrighty. That is super awesome. Let's give this a good build. Ooh. This is what happens when you rush through these things at actions. Oops. You guys love watching me debug these things, I swear. All right. Let's rebuild it one more time. Somebody once asked me, what's the difference between build and rebuild and clean? Well, real quickly. A build will just build your project. Notice how it went very quickly because we've already built it. Rebuild actually cleans and then builds. And clean just removes all the object files. And then you can build again and it, you know, rebuilds your code. So that's kind of the difference there. All right. So run this. Bam. As you can see, here's our original list before we've actually called the blocking filter. And it's got Bob in there. After we filtered it through the doFilter function, if named to lower equals Bob, then return false. The false or true will indicate whether or not it's going to be in the list when we're done. Because Bob is false, Bob is no longer in the list. That's all for this tutorial. Thank you for watching. I hope you found this educational entertaining and stay tuned.