 Hopefully you've been following this series from the beginning. Basically, we've created a very basic web application using html JavaScript jQuery jQuery mobile This is what it looks like here Running as a local file. I've also copied it to my website films are chris.com forward slash scripts forward slash list Is where it's at right now if you're watching this video two years from now, and it's not there anymore Things move on And you can quickly search through this list and I put it on my web server because in this tutorial We're just going to basically look at it making it seem like it's local application, but connecting internet for the information I think this is a much more efficient way Because you can modify and update the application without the user having to update anything on their system because basically we're creating a viewer to view our application that is written in html and JavaScript and we're doing this basically so you can write the application once And it'll run on pretty much any Operating system with a current browser on it, but we're packaging it to make it seem more like a standalone application If for some reason you want to distribute it with an installer of some sort You can put all this in the installer and have it install That being said I think in most cases you bear off just using a website just sometimes some people like Having things run local so you could do this all local if you watch previous tutorial with ggk gtk and web kit with Python we're going to basically the same thing today with c++ and instead of gtk. We're going to do Cute what you could do with Python as well. I'm just showing two different examples I use gtk in Python here. I'm going to use cute and this will be written in c++ Which I am not very good at c++, but this is a very basic application I'm going to try to do my best to To explain everything as best I can this code is even shorter than the Python code You actually probably be able to you'll have a on a Windows machine. It will be an executable thing what one of the There's pluses and minuses to both Python. You're going to have to have Obviously Python installed as an interpreter web web kit and the gtk or if you use qt the same thing And then you have a Python script which you could package within an executable in multiple different ways We're gonna get more into that in this series as we go on on different ways to make executables This is written in c++. So you'll have a a binary thing nice thing about the Python is since the script There's no recompiling but With this Although we'll write this once and this code will work on a Windows macro should work on a Windows macro Linux desktop machine Without any changes. You'll have to recompile it for each operating system You'll also have to recompile it if you're on a different architecture like if you wanted to run this on an arm processor So that's a drawback. You don't need to change code. You just need to recompile it But we'll jump right in here and once again To do this you'll obviously need your web kit modules installed and your qt Information installed I'm doing this on Linux all that's in the repositories. I'm not going to get into that because that's pretty simple Just search your repositories if you just install Qt designer even though we're going to do all this from the terminal that should install every package you need even though It's going to be installing more than you need but That's not part of the tutorial. Hopefully you already know how to install that if you're going to be writing this up, so Let's go ahead and minimize that go in here I'm in an empty directory here, and I'm going to use Vim as my text editor I'm going to create a c++ code file. I'll call it my list view dot cpp in Here I'll start I'll need to include two packages include Q application and include Qt web kit Ford slash Q web view Okay, and now we can start our main function so int main And here this this this little Bit of information here. I believe is mainly to grab arguments. Once again, I'm not the best It's that's I'm not that great at C, and I know even less about C plus plus but This is information I believe so you can pass arguments because I've used this before to pass arguments to an application Which we won't be doing here, but if I remove this I get errors, so I'm just leaving it in there So I'm sorry. I can't explain that better, but that's where we're at So within our main function, we are going to call Qt. I'm sorry Q Application we're going to create app pass it the non-existent arguments the count and the Variable information I believe is what these two stand for here and Then we're also going to create an object. It's going to be a web view object and We'll call it view so asterisk view equals New Q web view Okay So we're almost done We're going to want to Do our return because you'll always want to return information and we'll say app.exe C and That is what we created up here the app. We're just basically executing it when we get to the end here It will execute all the other code. I believe So now there's only three more things we need to put in here three more lines of code We want to give our default window a size We want to tell it where our HTML code is and then make it all visible with show so we're going to take our Object here that we created view and we're going to say use view and resize it To last time we said 600 with 800 height and then we'll say once again use our view object and this time we're going to load something We're going to load a Q URL in this case because we're going to be linking to the files in this case on my server And we'll give it the link Http colon forward slash forward slash films by chris comm forward slash scripts forward slash list forward slash Index dot HTML in this case another great thing about hosting this on your web server is that In this case, I'm using HTML, but you could also have server side scripts such as PHP Which I've been doing tutorials on but when it comes to server side Programs you can write that in any language you want So it's a very easy way if you want to write stuff in C write stuff in Python write stuff in Pearl or bash or PHP you can do all that on the server side and have your server do all the work and just output the HTML So if you know basic HTML and you have a server you can now write these Applications for any operating system not having to install you can you know you have your server so you know what your server can handle and Although you can write local things for Android with Python or local things in a shell script or bash script for for Android It can be kind of difficult to distribute that so doing it this way using HTML as your interface you can use your server side script and write in whatever language you want So that's a big benefit of writing applications like this so Now the last thing we need to do is take our view object and we're saying show So this code right here is a lot shorter than our Python code, which is nice automatically puts in the scroller there for you and Show will show all so all we do now is save this and now We're going to say Q make which hopefully you have installed as I talked about at the beginning you want to install those packages first dash project so Q make dash project and When I list out you can see it created a new little Project based on the name of our folder. So my folder is called my list and it create project folder or file So now I can view Or I'm sorry use Vim to view this and edit it because we need to add a line to this so right here automatically it put in here that our main source file is the My list view dot CPP we need to add a line to so that when we compile it It knows to include the Qt webkit. So we're going to say Qt space plus equals webkit Now we've done that We just need to run Q make and then make and it should do fold all Fatal error no such directory I think part of my problem might be I think let me remove The make file. I'll remove my my list Project file because I think and I've done this before we want our CPP file to be the same as our Folder name when we're working with Qt here So let's move our my list view that CP to my list since that's what I named the folder You're I forgot with Qt. You want to make sure that your main? CPP file is the same name as your the folder in because that's gonna be your project name now I will do Q make I'm glad I did that because if I didn't do that in this video You guys might have done it and not know what was going on. So Q make dash project it create our Project file here. So I'm going to Vim into that Pro I'm going to add our Information here on Qt plus equal webkit to include the Qt webkit here save that then I'm going to say Q make and then make and I Am still getting that error. Oh, I Do think I was right about renaming that folder the folder and the file the same I could be wrong as well, but I think I'm right on that, but I think it's just a typo in my code. Oops We've got here import Webkit, I think the K needs to be capital Yeah, that would be it so now Q make and Make okay good to go. Sorry about that. So I have a list that out You can now see that I have an executable file here called my list And I'll say colon for slash my list when I run that it opens it up and It's 600 by 800 in width and height We can of course search through our list and if we made these executable they'd be executable and even though this seems like a Standalone application. It's actually connecting to my server Which really the only drawback in my opinion of having it run on your web server is the fact that you need an internet Connection but really who doesn't at these points But you can also connect it to a local file as I showed with the previous drill using a python and GTK with webkit You just need to point it to the local file rather than a remote file Close that and it closes the window so that's pretty much it once again To compile this for Windows or Mac you can do that Without having to change the code at all You can you should be able to cross compile for Windows I have never been able to find a way to cross compile for Mac so to get this to work You will actually as far as I know need a Mac machine with Mac OS to compile this For that for Windows you should be able to cross compile. I'm not going to get into that on on this tutorial So drawback is you have to recompile it for each system and architecture that you wanted to run on But you don't need to change the code at all Also when distributing it obviously you'll have your executable file. You'll also need to package it with your need libraries once again as I've been trying to get across with all these tutorials on Using HTML and JavaScript as our user interface and using other programs as the back-end whether it be local or remote on the server The basically Writing the program is the easy part What's just different what's difficult is the distribution of it? Because every operating system does it differently Linux makes it pretty easy with their package managers You can create a package and you can have that package call the package manager for Dependencies Windows there's really not an option for that currently so you either have to package all the dependencies into your installer Or have your installer download it kind of like when you go to install an application on Windows And it says oh you need ActiveX or oh you need flash which are two things you priori have installed But there's examples like that and it either downloads them from your net or if you got it on a CD It might have that in a folder already Luckily if you're working with open source dependencies You're not much of an issue if you're working with proprietary stuff You may not be allowed to package it with your system So that's another reason why you might need to have your installer download it from the internet So I hope that you're enjoying this tutorial these the series showing you how easy it is to to wrap code that's written HTML and With JavaScript as a standalone application You'll still have to package it As far as an installer of some sort We're gonna get a little more into that as this series goes on right now. I'm just looking at basically wrapping the code and That's pretty much it. I Hope that you're enjoying these tutorials. Please be sure to click on the annotation for the entire playlist Visit my website films by chris.com. That's chris the K if you have any questions That are technical questions the comments below are probably not the best spot because I probably won't even see them Especially as this video gets older in time your best way to get questions answered From me is try to connect up with me in the IRC channel Don't come into the IRC channel just looking for me come to the IRC channel to chat with people on that channel It's the reason I have the IRC channel because I can't always be there I can't answer every question But we have a community going in there and hopefully someone in there will be able to help you or Point you in the right direction if they can't help you and if I'm around I'll do my best to answer your questions You can get there. We're on free note. It's pound films by Chris once again That's chris the K you go to my website films by chris.com. That's chris the K. There should be a link in the description In there on my current website if you're watching this for a while now my site might change But there should be a link somewhere to the IRC channel currently It's under the social networking tab click on IRC will bring up a web interface to the IRC channel That's one way of getting there if you don't have a IRC client already. So I Thank you for watching I'll try to remember to put a link in the description to the source code for this and I hope that you have a great day