blob: 183424d6aa284e353c3fbf606fda788004a67213 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# Qt CLI (Command Line Interface) Tool
A tool for creating Qt projects or files from the command line.
## Build
To build the project, ensure you have Go installed on your system.
### Build the `qtcli` Binary
```bash
$ go build .
```
## Usage
Currently `new` command is prepared for creating C++ class as well as C++ source
and header files.
Below is the command-line output when you run qtcli without any arguments.
```bash
$ ./qtcli
A CLI for creating Qt project and files
Usage:
qtcli [flags]
qtcli [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
new Create a new project or file(s)
Flags:
-h, --help help for qtcli
-v, --version version for qtcli
Use "qtcli [command] --help" for more information about a command.
```
### How to create C++ class
```bash
$ ./qtcli new class MyObject --type cpp --output-dir output
$ ls -lrt output
total 8
-rw-rw-r-- 1 bencho bencho 258 Nov 12 10:07 MyObject.h
-rw-rw-r-- 1 bencho bencho 192 Nov 12 10:07 MyObject.cpp
```
Additional flags can be used, for example:
```bash
$ ./qtcli new class MyObject --type cpp --base QObject --include QObject --include QSharedData --include QDataStream --add Q_OBJECT --add QML_ELEMENT --qobject
```
A full list of available flags can be found using the --help option.
### How to create python class
```bash
$ ./qtcli new class MyObject --type python --module PySide6 --import QWidget --output-dir output
```
## License
This extension can be licensed under the Qt Commercial License and the LGPL 3.0. See the text of both licenses here.
|