 Hey, everybody, it's Brian. Welcome to the 142nd Qt tutorial. We're going to continue on with a QML in Qt Quick. This says Qt 4. I really all I did is I took the Qt 3, our previous tutorial, and just renamed it to Qt 4 because we're going to mess with this a little bit. Rather than waste your time retyping all this stuff out, I just wanted to reuse our code here because, well, code reuse is pretty awesome. So when we run this, we can see exactly what we were doing in the previous tutorial. We just have this big rectangle, this rec center, which is green. And then we have all these lime green squares that are anchored around. And we have a mouse area that fills the entire window. And when we click, ta-da, it shrinks. So really what Qt Quick 3, our previous tutorial was, was just anchoring on steroids. We went around positioning and showed how we can anchor things. So this tutorial is going to really describe the difference between parent-child relationships and anchoring and how they're impacted when you start doing animations. So we're going to close this. First thing we're going to do is import. And we're going to answer a question. I had a question from SnarkyBoy69, which is an interesting name, who said, now that we're doing QML, does that mean we no longer have access to any controls like buttons and sliders? Well, no. Actually, as you can see, if we scroll on down here, there is a whole list of Qt Quick controls. And we're going to just import controls 1.3. Go ahead and give it a good build just to make sure you got it. If you get an error message, then try a previous version like 1.0. It just means you won't have it installed if you get an error message. Then we're going to comment this out, our little mouse area here. And we are going to say slider. And just out of habit here, we're going to say ID slide. I messed up my elbow at the gym. It's making my typing all weird. All right, so we're going to run this. And you now see this beautiful slider at the top here. And you can move this around. So what we're going to do is we're going to wire up the events from this slider to this big green rectangle and rotate this thing. It's actually fairly simple. Very simple. I can't even talk today. Geez. Min value zero. Max value. And we'll say 360 because we want to be able to rotate this thing. 360 degrees. I want to say the current value is zero. Enabled just because. Why not? And then we're going to do our on value changed. And this is our actual, you know, our event. Now, remember our rectangle is called rec center. So we're going to grab this and we're going to say rec center dot rotate. I'm sorry, rotation equals slide dot value. So now we save and run this thing because we've anchored. What do you think is going to happen? Do you think all these are going to rotate with it? No, they do not. The reason for that is they are anchored, but they're not children. So we can move the mouse around here on the slider. But you can see they're not moving with it. That's the difference between a anchor and a parent child relation. To kind of solidify that, we're just going to grab a few of these here. And we're going to put them in as children here. So now we've got our rectangle and we've got our two green boxes as children. And these others are just disconnected anchors. So when we run this again and we start to rotate, you can see the two that we put in as children are rotating with the parent. But all the others are just simply sitting there. So that's the difference between an anchor and a parent child relationship with an anchor. You guessed it, if it is a child and it's anchored, it will move and animate with the parent. So some of you have probably worked with what is that called shockwave flash or is it macromedia flash? I always get those confused. And you're thinking, oh, that's what this is. I've got to make a bunch of vector graphics. Well, you can, but it's really not recommended. The recommended way is to actually use images because, as I've said, they're faster. So we're just going to cut that scroll all the way down to the end here. And, well, the whole thing will now rotate. Pretty neat, pretty simple. But it's one of those concepts you really got to understand in order to move forward in future tutorials. Now you understand that when you anchor, you're simply taking an object and positioning it with another object. It's different in the sense that you are not saying x, y. While you can say x, y, it's much different because it's not an absolute position, it's a relative position. And if it is a child of the parent, it will be modified with the parent. So quick, simple, easy tutorial, but a pretty high level concept that you need to understand. So that's all for this tutorial. Very short one, I know. Actually, kind of like it looks like a snowflake almost. That one just looks kind of drunk, but whatever. If you find this educational entertaining, be sure to visit voidrumbs.com. I will have the source code for this and all other tutorials out under acute, way in the back. And feel free to join the Voidrumbs Facebook group. There's 450 plus of us out there. All different languages, all different skill sets, and we just help each other out. Thanks for watching.