 Hey everybody, this is Brian and welcome to the 17th Qt tutorial with C++ and GUI programming. Today we're going to be covering the Q checkbox. So let's just drag and drop one of these little guys on here. And it's got a push button on too. And the infamous click me. And let's just say I like cats. Just for the sake of argument, bear with me here. Now a checkbox probably looks very familiar to you. You've probably seen a million of these in your lifetime and you just need to know how to work with one. Let's run this just so I can show you what it does. The checkbox is a graphical representation of a boolean value on or off, true or false. So checked, unchecked, checked, unchecked. That's really all this control does. Now let's right click here. Go to slot, clicked. You should be an expert at that right now. And this is how you access that control. You could say UI, checkbox, set checked. And we'll say true. Actually, let's just cut that and throw that right in the constructor. That way it's checked when the dialogs loaded. And then we're going to add a little bit of logic here. Let's say if UI.checkbox is checked. In Qt, if it's a boolean value, it'll use the word is in front of it. So is checked. That'll return a boolean and we can say else. And let's just add a Q message box in here. This and we'll say cats. And we'll say you like cats. And if they don't like cats, remember this is our if else. We'll just say you don't like cats. Save your work. And the logic here is very simple. When the buttons clicked, it's going to read the is checked value out of the checkbox. If it is checked, it's going to say you like cats. If it's not, it's going to say you don't like cats. And let's just run this. And remember in our constructor, it's setting UI.checkbox.setCheckTrue. So it's going to be checked by default. You can say you like cats and you can uncheck that. Click again, you don't like cats. So that is the Q checkbox. Very simple, easy to use control. Also very powerful. You use a lot of these in your applications. I realize this is a short tutorial, but this is a relatively simple control. It's kind of a no brainer. So thank you for watching. I hope you found this video educational and entertaining.