mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
This appears to be incompatible with pyinstaller. I get the following when trying to run the executable generated with pyside6: ``` Traceback (most recent call last): File "qt_ui\main.py", line 29, in <module> File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module File "qt_ui\windows\QLiberationWindow.py", line 28, in <module> File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module File "qt_ui\widgets\map\QLiberationMap.py", line 11, in <module> ImportError: could not import module 'PySide6.QtPrintSupport' ```
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
from PySide2.QtGui import QIcon, Qt
|
|
from PySide2.QtWidgets import QDialog, QVBoxLayout, QPushButton, QHBoxLayout
|
|
|
|
from qt_ui.windows.preferences.QLiberationPreferences import QLiberationPreferences
|
|
|
|
|
|
class QLiberationPreferencesWindow(QDialog):
|
|
def __init__(self):
|
|
super(QLiberationPreferencesWindow, self).__init__()
|
|
|
|
self.setModal(True)
|
|
self.setWindowTitle("Preferences")
|
|
self.setMinimumSize(300, 200)
|
|
self.setWindowIcon(QIcon("./resources/icon.png"))
|
|
self.preferences = QLiberationPreferences()
|
|
self.apply_button = QPushButton("Apply")
|
|
self.apply_button.clicked.connect(lambda: self.apply())
|
|
self.initUI()
|
|
|
|
def initUI(self):
|
|
layout = QVBoxLayout()
|
|
layout.addWidget(self.preferences)
|
|
layout.addStretch()
|
|
apply_btn_layout = QHBoxLayout()
|
|
apply_btn_layout.addStretch()
|
|
apply_btn_layout.addWidget(self.apply_button)
|
|
layout.addLayout(apply_btn_layout)
|
|
self.setLayout(layout)
|
|
|
|
def apply(self):
|
|
if self.preferences.apply():
|
|
print("Closing")
|
|
self.close()
|
|
else:
|
|
print("Not Closing")
|