 Hey everybody, this is Brian and welcome to the 14th video tutorial on Qt Programming with C++. Today we are just going to cover the basics of GUI programming. So go File, New and then do a C++ Qt GUI application. And I'm just going to name this GUI and let's throw this in our usual location wherever you put your projects. And I'm just going to choose a Q dialog. And if you've been following along with the tutorials, this is all pretty much a review at this point for you. This is our Q dialog and you can resize it, go into Edit and you know there's our project file, here's our dialog.UI, our dialog header, dialog source, main source. This is all review. So what we're really going to focus on is putting controls on your dialog and how to work with those controls. And we're going to start off with the Q label. Now you notice over here in the toolbar you can actually type and it will filter things out for you. It's very handy if you've got a lot of controls in there. This is a Q label. Notice how you can resize it, move it around. And over here is your object explorer. You see here's your dialog and when you click it, it actually selects a dialog and we have a label. When you click label, it selects a label. Down here is the properties window. You notice how when you select different things, the property changes. It's the properties of the selected object. Let me actually expand this out so you can see it a little better. You notice how it says Q object, object name label, well everything descends from Q object so it's always going to be there. And then Q widget because label is also part of the Q widget. This goes into the C++ inheritance chain and multiple inheritance. And you can just scroll down and you see there's a lot of properties. But basically what a label is really good for is just displaying text. And you notice how it's actually even bold faced text. And that's the text of the label. You can change this to hello world. You can even bring up an editor and you can format it in specific ways. For example, if you want a bold italic underline. And if you're wondering, flip over to source, it's just HTML. So you can actually have HTML encoded controls. And that is pretty neat. And you can do all that with the editor. You don't have to type any of that out. Just control R to run your application. Or if you want to debug, I believe it's F5. It'll build it, run it, and there you go. Now another way of working with this is actually via code. And let's go into dialog.cp. And let's right here is our constructor. And we're going to say UI label, because that's the name of the control label. And we're going to say set text. And we'll say, let's just say hello everyone. And let's run this and see, sure enough it says hello everyone. Now notice we lost the formatting. That's because there is no HTML formatting in here. Let's actually just throw a little bit in here just so you can see how to do this manually. These are called HTML aware controls. Just run this again. See how a bold face hello and not everyone. All right. Now if you're wondering how do you know what's on your form? I mean you look in dialog.h and you don't see a reference to a label in here anywhere. But you do see a pointer to this UI. It's called UI and it's a dialog. Well that's your dialog right here. Now how do you find what's on there? Well other than just looking around and going through Object Explorer, you can actually go edit and look at the XML source. It's really all this dialog is, is just a big XML document. And when you scroll down you see Widget Class Q label. There's your label name. And then you've got these specific properties like the X location, Y location, width, height, et cetera, et cetera. Really don't modify this unless you really feel adventurous because you can really screw up your dialog. Always try to use the GUI interface for modifying your GUI. It's much simpler, much cleaner. One thing you should really note out of this whole thing is it's very quick to build an application and then you can even filter out some properties here. I type test instead of text. There we go. And you can just say, you know, LOL. And that's the bare bones basics. Now you notice how even though we typed LOL and then we ran it, we got hello everyone. Remember, that's because we have it in our dialogs constructor here. So you should always note that the code you write will override the interface. Well, this is Brian and in this tutorial you learn the basics of working with Qt Creator and the Qt Designer and also the Q label which is the simplest of controls. Thank you for watching. I hope you found this video educational and entertaining.