chore: scaffold PySide6 application
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
PySide6==6.5.3
|
||||
shiboken6==6.5.3
|
||||
Pillow==9.5.0
|
||||
PyInstaller==5.13.2
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtWidgets import QLabel, QMainWindow
|
||||
|
||||
from version import APP_NAME, APP_VERSION
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setWindowTitle("{} v{}".format(APP_NAME, APP_VERSION))
|
||||
self.resize(1280, 720)
|
||||
|
||||
label = QLabel("自动合成印花服饰效果图工具\n\n工程骨架已创建")
|
||||
label.setAlignment(Qt.AlignCenter)
|
||||
self.setCentralWidget(label)
|
||||
|
||||
self.statusBar().showMessage("就绪")
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
from PySide6.QtWidgets import QWidget
|
||||
|
||||
|
||||
class ExportPanel(QWidget):
|
||||
pass
|
||||
@@ -0,0 +1,7 @@
|
||||
from PySide6.QtWidgets import QGraphicsScene, QGraphicsView
|
||||
|
||||
|
||||
class ImageCanvas(QGraphicsView):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
self.setScene(QGraphicsScene(self))
|
||||
@@ -0,0 +1,5 @@
|
||||
from PySide6.QtWidgets import QWidget
|
||||
|
||||
|
||||
class ImageListPanel(QWidget):
|
||||
pass
|
||||
@@ -0,0 +1,5 @@
|
||||
from PySide6.QtWidgets import QWidget
|
||||
|
||||
|
||||
class TemplatePanel(QWidget):
|
||||
pass
|
||||
@@ -0,0 +1,5 @@
|
||||
from PySide6.QtWidgets import QWidget
|
||||
|
||||
|
||||
class TransformPanel(QWidget):
|
||||
pass
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
def run_batch(*args, **kwargs):
|
||||
raise NotImplementedError("Batch composition is not implemented yet.")
|
||||
@@ -0,0 +1,2 @@
|
||||
def compose_image(*args, **kwargs):
|
||||
raise NotImplementedError("Image composition is not implemented yet.")
|
||||
@@ -0,0 +1,18 @@
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
@dataclass
|
||||
class ImageAsset:
|
||||
path: Path
|
||||
selected: bool = True
|
||||
|
||||
|
||||
@dataclass
|
||||
class TransformState:
|
||||
x: float = 0
|
||||
y: float = 0
|
||||
width: float = 0
|
||||
height: float = 0
|
||||
rotation: float = 0
|
||||
keep_aspect_ratio: bool = True
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import sys
|
||||
|
||||
from PySide6.QtWidgets import QApplication
|
||||
|
||||
from app.main_window import MainWindow
|
||||
from version import APP_NAME
|
||||
|
||||
|
||||
def main():
|
||||
app = QApplication(sys.argv)
|
||||
app.setApplicationName(APP_NAME)
|
||||
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
|
||||
return app.exec()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
def load_config():
|
||||
return {}
|
||||
@@ -0,0 +1,5 @@
|
||||
SUPPORTED_IMAGE_EXTENSIONS = {".png", ".jpg", ".jpeg", ".webp"}
|
||||
|
||||
|
||||
def is_supported_image(path):
|
||||
return path.suffix.lower() in SUPPORTED_IMAGE_EXTENSIONS
|
||||
@@ -0,0 +1,8 @@
|
||||
import logging
|
||||
|
||||
|
||||
def setup_logging():
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
||||
)
|
||||
@@ -0,0 +1,2 @@
|
||||
def load_templates():
|
||||
return []
|
||||
@@ -0,0 +1,2 @@
|
||||
APP_NAME = "自动合成印花服饰效果图工具"
|
||||
APP_VERSION = "1.0.0"
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user