# Quick Start

## Installation

open the terminal and paste those commands, to install the Qtica library

{% tabs %}
{% tab title="pip" %}

```bash
pip install virtualenv
virtualenv -v .venv
source .venv/bin/activate
pip install qtica
```

{% endtab %}

{% tab title="Github" %}

```bash
git clone https://github.com/qtica-project/Qtica.git -o Qtica
cd Qtica
pip install virtualenv
virtualenv -v .venv
source .venv/bin/activate
pip install poetry
poetry install
```

{% endtab %}
{% endtabs %}

## Usage

To make your first app, create a new `main.py` file, and paste this code into it.

{% tabs %}
{% tab title="Qtica" %}
{% code title="main.py" %}

```python
#!/usr/bin/python3

from Qtica import BehaviorDec
from Qtica.widgets import Application, MainWindow, Label
from PySide6.QtCore import QSize, Qt


class Window(BehaviorDec):
    def __init__(self):
        return MainWindow(
            uid="window",
            home=Label(
                text="Welcome to Qtica!",
                setAlignment=Qt.Alignment.AlignCenter,
                qss={
                    "color": "#7423FF",
                    "font-size": "24px"
                }
            ),
            qss={
                "background-color": "#101117"
            }
        )


def main():
    import sys
    app = Application(sys.argv)
    window = Window()
    window.resize(QSize(500, 200))
    window.show()
    sys.exit(app.exec())

if __name__ == "__main__":
    main()
```

{% endcode %}
{% endtab %}

{% tab title="PySide6" %}

```python
from PySide6.QtCore import QSize, Qt
from PySide6.QtWidgets import QApplication, QMainWindow, QLabel


class Window(QMainWindow):
    def __init__(self, parent: object = None):
        super().__init__(parent)

        label = QLabel(self)
        label.setText("Welcome to Qtica!")
        label.setAlignment(Qt.AlignmentFlag.AlignCenter)
        label.setStyleSheet(
            """
            color: #7423FF;
            font-size: 24px;
            """
        )

        self.setStyleSheet(
            """
            background-color: #101117;
            """
        )
        
        self.setCentralWidget(label)

def main():
    import sys
    app = QApplication(sys.argv)
    
    window = Window()
    window.resize(QSize(500, 200))
    window.show()
    
    sys.exit(app.exec())

if __name__ == "__main__":
    main()
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://qticaproject.gitbook.io/qtica/quick-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
