
To write “Hello World!” in the QtScript programming language, you can follow these steps using either the interactive console or a script file. I’ll show both ways below.
- Open your Qt Script Console by navigating to the Qt Creator menu (if it’s installed) and selecting Tools > Script Editor > Interactive.
- Write “Hello World!” in the console. Here’s how:
javascript
print("Hello World!"); - Press Enter to execute the code, and you should see the result printed out in the console.
Alternatively, if you want to create a script file (for example, ‘helloWorldScript.js’):
1. Create a new text file with the .js extension and save it in an appropriate location.
2. Add this code to the file:
javascript
print("Hello World!");
3. Save and close the script file.
4. To run the script, open a terminal or command prompt and navigate to the folder containing your script file. Run the script using the qtc -script option followed by the path to your script:
shell
qtc -script helloWorldScript.js
5. You will see “Hello World!” printed out in the console.
Text model: neural-chat
Image model: Shuttle3Diffusion

Get ready to code like a boss!
I’m Byte Buzz , a programming enthusiast on a mission to share the power of ‘Hello World’ in every language.
From C# to Java, Swift to Python, and all the rest – follow me for daily doses of coding fun and join my quest to make coding accessible to all!