diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/app.py b/src/app.py new file mode 100644 index 0000000..bb3cec7 --- /dev/null +++ b/src/app.py @@ -0,0 +1,14 @@ +import sys +from PySide6.QtGui import QGuiApplication +from PySide6.QtQml import QQmlApplicationEngine + +if __name__ == "__main__": + app = QGuiApplication(sys.argv) + engine = QQmlApplicationEngine() + engine.addImportPath(sys.path[0]) + engine.loadFromModule("ui", "Main") + if not engine.rootObjects(): + sys.exit(-1) + exit_code = app.exec() + del engine + sys.exit(exit_code) \ No newline at end of file diff --git a/src/models/__init__.py b/src/models/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/models/author.py b/src/models/author.py new file mode 100644 index 0000000..a26c49e --- /dev/null +++ b/src/models/author.py @@ -0,0 +1,12 @@ +from sqlalchemy import Column, Integer, VARCHAR +from sqlalchemy.orm import relationship +from sqlalchemy.ext.declarative import declarative_base + +Base = declarative_base() + +class Author(Base): + __tablename__ = "author" + + id = Column(Integer, primary_key=True) + first_name = Column(VARCHAR(length=50)) + last_name = Column(VARCHAR(length=50)) \ No newline at end of file diff --git a/src/ui/Main.qml b/src/ui/Main.qml new file mode 100644 index 0000000..29374fa --- /dev/null +++ b/src/ui/Main.qml @@ -0,0 +1,32 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +Window { + width: 300 + height: 200 + visible: true + title: "Hello World" + + readonly property list texts: ["Hallo Welt", "Hei maailma", "Hola Mundo", "Привет мир"] + + function setText() { + var i = Math.round(Math.random() * 3); + text.text = texts[i]; + } + + ColumnLayout { + anchors.fill: parent + + Text { + id: text + text: "Hello World" + Layout.alignment: Qt.AlignHCenter + } + Button { + text: "Click me" + Layout.alignment: Qt.AlignHCenter + onClicked: setText() + } + } +} diff --git a/src/ui/qmldir b/src/ui/qmldir new file mode 100644 index 0000000..f41aece --- /dev/null +++ b/src/ui/qmldir @@ -0,0 +1,2 @@ +module Example +Main 254.0 Main.qml \ No newline at end of file