 Hey everybody, this is Brian and this is our 7th Qt tutorial. Today I'm going to show you how to make a very minimal application. Just go file new project, empty Qt project. And then just give it a name. We'll just call this minimal. Throw it in your usual location wherever you've been building these. And next, choose your framework. See we have an empty project file here. We're just going to right click the project, go to add new, C++ and just say source file. And I like to call my main source file main just so I know where the main function is. Alright, now when you click your minimal.pro you see that it said sources plus equal main.cpp. Meaning it just added this source file into the project so it's going to compile and look for the main function in here. Alright, let's just add our includes. And don't worry if you don't know what any of these are right now. I'm going to go over them here in a little bit. Just kind of follow along here. And of course we need a main function. And if you're wondering what these arguments are here, let me finish typing this out here. Sorry, it's hard to multitask. It's been a very, very long day at work. This is our main function which you should know from C++ programming. Int, argc, this is the number of arguments. And care pointer to an array of characters. Basically that is the individual argument pointers. Alright, let's go queue application. I like to use IntelliSense as much as possible. Actually a very lazy programmer and I don't like to type. I know some people out there like using the most basic programming tools available so they have to type everything out. I am just not one of those people. I like to definitely use my time for other things. Alright, let's see here label. And what we're doing now is we're just going to create a new label. We've created an application object, the line above. So here's our new label and we're going to just say basic hello world. I know we've already done a hello world application but I wanted to do a very minimal application and just show you what is possible here with Qt. Alright, and now label show. Now if you remember right, when you have a widget, remember a Q label is a widget and you do show and we haven't created a window, Qt will automatically encapsulate that inside of a window and show that window. Let's do a return app.exec. And what that does is it returns app.exec. App.exec is just a loop that loops over and over and over again. And it's saying here I have some sort of error. Here we go. Too many little parentheses there. Alright, so let's review real quick. We have a include Q application. This is the very basic lowest com denominator that you need to run a Q application is the Q application object. We are generating a Q label and here we go right here. Q label pointer to label, equal new Q label and we're going to say hello world and we're going to do label show return app.exec. Now you may be wondering why we're doing Q application app. Why are we creating an instance of Q application? Well in order to execute the application, you have to create an instance of it. So the very first step is Q application must be created and we typically just pass the arguments to it. And then we do some initialization here and then we just enter the message loop waiting for the window to process messages. Just go ahead and run this. And it's going to take me just a second. I have to resize the window in order to pull it over here. But as you can see, this is what it looked like when it created it. Just hello world. Nothing fancy, nothing major. You took the label, wrapped it in a window. Now one thing that's very interesting about Qt is that it can do very, very good text processing here. So let's say we want that bold and let's say we want this italic. Now if you're wondering what these funky character codes are, it's HTML encoding actually. All Qt widgets are HTML aware. So you can use actual HTML codes and it'll process them and render them as you run the application. So let me pull this over here and you see how hello is now bold and world is italicized. So that's a very, very easy way to make some pretty snazzy little graphics here. And you can even do things like, let's do, I'm going to cheat here and look in my Qt programming book that I bought a while ago. Oh yes, let's do this. Font color equal red. And you notice how we're not putting quotes and end quotes in here. You don't really need them. The Qt engine would just strip them out and ignore them anyway, so they're not really needed. So what we're going to do is we're going to say hello in very big letters and then we're going to say in red italicized world. Let's compile and run this and there we go. Hello world. Pretty neat stuff, huh? Now if you're wondering why that hard return in there, we're getting that from the header automatically throws in a hard return. I think that's actually part of the HTML standard. So let's throw it at the end, compile, rerun it. Let's see if I can drag it here. There we go. All right, this is Brian. We covered a very basic minimal Qt application, the components you need and the fact that all Qt widgets are HTML aware. Thanks for watching. I hope you found this video educational and entertaining.