Skip to content

Build your own program

Christopher Dean edited this page Apr 20, 2022 · 9 revisions

Stay a while and listen...... How to build your own KZP program

Deckard Cain

Qml is the language used to build programs ran inside of KZP.

There are very technical and specific things to learn and about Qml to become a master. You won't find that here. Instead this guide will help you get started building and help you learn along the way.

Its dangerous to go alone, get yourself some tools:

Tools are very important. However you have a choice in what tools you use.

image

At the minimum you need access to a web browser and a Windows or Linux PC with a few pieces of software.

Get yourself something to write code with. Sure you can use notepad or vim, or whatever you want. But you have to use something!

Code Editor

There are many choices but a couple graphical ones are suggested below. The following example images will be using Qt Creator

  • Qt Creator download the appropriate file for your OS, run and install. (.exe or .run)
  • Visual Studio Code - Step to install can be found on the page
  • Notepad++ - Step to install can be found on the page
  • Kate - Step to install can be found on the page

Git The base project!

I have created a base project to fork from if you would like to contribute a face to the KZP home page read here. The base project can be found at https://github.com/ProtozeFOSS/KZPBase

Use git to either fork/clone the project or select download zip

image

You can install the base project (directory) or your own program by placing it in the AppData location. This is the same directory that "Set Qml" opens to in KZP.

Load the base project in Qt Creator and in Kraken Z Playground

In Qt Creator use the [File->Open File or Project] menu item to open the "project.pro" in the KZPBase project directory

Use the "Set Qml" button in KZP to load the "main.qml"

Now we are loaded and running the base project. If you have had trouble, reread the earlier steps and make sure you understand. If you have questions please ask for help in discord as you might help improve this guide! 😊

image

Final message before you begin

During the reading of this tutorial you may want to reference the documentation on the objects exposed from C++.

This tutorial will be using the clock example from KZP to showcase the power of Qml.

If you have not, head over to the installing examples guide and follow it to install the Clock example used in this tutorial.

button_begin-your-quest