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' ```
60 lines
2.0 KiB
Python
60 lines
2.0 KiB
Python
from PySide2.QtWidgets import QGroupBox, QHBoxLayout, QLabel, QVBoxLayout
|
|
|
|
from game.ato.flightwaypoint import FlightWaypoint
|
|
|
|
|
|
class QFlightWaypointInfoBox(QGroupBox):
|
|
def __init__(self) -> None:
|
|
super(QFlightWaypointInfoBox, self).__init__("Waypoint")
|
|
self.x_position_label = QLabel("0")
|
|
self.y_position_label = QLabel("0")
|
|
self.alt_label = QLabel("0")
|
|
self.name_label = QLabel("")
|
|
self.desc_label = QLabel("")
|
|
self.init_ui()
|
|
|
|
def init_ui(self) -> None:
|
|
|
|
layout = QVBoxLayout()
|
|
|
|
x_pos_layout = QHBoxLayout()
|
|
x_pos_layout.addWidget(QLabel("<b>X : </b>"))
|
|
x_pos_layout.addWidget(self.x_position_label)
|
|
x_pos_layout.addStretch()
|
|
|
|
y_pos_layout = QHBoxLayout()
|
|
y_pos_layout.addWidget(QLabel("<b>Y : </b>"))
|
|
y_pos_layout.addWidget(self.y_position_label)
|
|
y_pos_layout.addStretch()
|
|
|
|
alt_layout = QHBoxLayout()
|
|
alt_layout.addWidget(QLabel("<b>Alt : </b>"))
|
|
alt_layout.addWidget(self.alt_label)
|
|
alt_layout.addStretch()
|
|
|
|
name_layout = QHBoxLayout()
|
|
name_layout.addWidget(QLabel("<b>Name : </b>"))
|
|
name_layout.addWidget(self.name_label)
|
|
name_layout.addStretch()
|
|
|
|
desc_layout = QHBoxLayout()
|
|
desc_layout.addWidget(QLabel("<b>Description : </b>"))
|
|
desc_layout.addWidget(self.desc_label)
|
|
desc_layout.addStretch()
|
|
|
|
# layout.addLayout(name_layout)
|
|
layout.addLayout(x_pos_layout)
|
|
layout.addLayout(y_pos_layout)
|
|
layout.addLayout(alt_layout)
|
|
layout.addLayout(desc_layout)
|
|
|
|
self.setLayout(layout)
|
|
|
|
def set_flight_waypoint(self, flight_wpt: FlightWaypoint) -> None:
|
|
self.x_position_label.setText(str(flight_wpt.x))
|
|
self.y_position_label.setText(str(flight_wpt.y))
|
|
self.alt_label.setText(str(int(flight_wpt.alt.feet)))
|
|
self.name_label.setText(str(flight_wpt.name))
|
|
self.desc_label.setText(str(flight_wpt.description))
|
|
self.setTitle(flight_wpt.name)
|