 Hey everybody, this is Brian and welcome to the 77th Qtutorial with C++ and GUI programming. Alright, let's call this Line Caps. And yes, I'm still very sick, so please forgive me if I sound a little weird. Some people would argue I always sound weird, but we ignored them anyways. Okay, open up dialog.h and we're just going to add our includes here. And then we're going to, of course, override the paint event. You have no idea what I'm doing. You know, as I've said in other videos, please go back and watch the start of this section. It'll make things much, much clearer. But if you're just catching up, overriding the paint event, because every time the dialog wants to paint, we need to be able to tell it what to paint. And this tutorial, we're going to be covering what are called Line Caps. So let's just make a Qpen. Let's call it Pen. And we're going to give it the Qt, we're going to give it black. We'll say Pen, Set Width. And we're going to make these really, really thick, say 15. And we're doing this mainly so it'll show up really good in the video, because I know the video is a little blurry compared to what I see on my screen. Now we're going to make a Q-point object. I'm going to call this Start Point. And we're going to put this at 20, 30. That's X and Y. And we'll copy and paste magic here. Somebody had messaged me and told me the really cool shortcut. I wish I remembered. I think it was like Control Up or something like that. It basically redos the same line you just typed. But darn it, I forgot. I'm very sorry. So we're going to say Pen. And we need to set the cap style. And we're just going to say Qt Flat Cap. Now, what is a cap? A cap is the very end of the line. How Qt actually draws it. It has several different things it can do. So we're going to say Set Pen. And we're just going to add our pen in there. And then Painter. We're going to draw a line. And we're going to just give it Start Point. And of course End Point. Let's compile and run this real quick. Just so we can get some explanation going on here. Maybe once this builds. There we go. So we have our Start Point. And we have our End Point. And the cap is actually the very end of this line. How Qt decides to draw that. Now this looks like just a plain old boring line that you've seen a million times. But you notice how it's got the Flat Cap. Well, that's the default. It's the Flat Cap. So now we're going to go through. And we're going to actually create a couple more. And let's just grab these. Because we need to... We're just going to reuse the same points. We're just going to move them down the screen a little bit. So we're going to say Start Point. And we're going to say Set Y. And we're going to move it down to 50. And we're going to say End Point. Set Y and of course 50. Because we want them to be a straight line. And we want to give it a square cap. And you notice how we have to set the pen. Because we've modified the pen. We need to reset it. That way it copies that object in the memory. And we're just going to copy and paste this one more time. And we're going to put this at 70-70. And we're going to give this a round cap. Save and run. And with any luck it'll compile. And there we go. You notice that we have three lines here. And they each look a little different. Here's our flat cap. Which is the default. It just stops drawing. Our square cap actually adds an extra bit of width here. Or I should say a bit of length. That's square shaped. And then we have the round cap. Which is nice and rounded. Now all of the cap styles are in the acute help. But I just want to demonstrate how to use them. And basically what they very simply look like. So this is Brian. Thank you for watching. I hope you found this tutorial educational and entertaining. Keep up on that feedback guys. I enjoy hearing from Brian.