Revert upgrade to pyside6.

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'
```
This commit is contained in:
Dan Albert
2021-11-21 17:34:08 -08:00
parent f3bf9c0c3c
commit 2a75d14e0e
96 changed files with 189 additions and 186 deletions

View File

@@ -1,4 +1,4 @@
from PySide6.QtWidgets import QLabel, QHBoxLayout, QGroupBox, QPushButton
from PySide2.QtWidgets import QLabel, QHBoxLayout, QGroupBox, QPushButton
import qt_ui.uiconstants as CONST
from game import Game

View File

@@ -1,7 +1,7 @@
from datetime import datetime
from PySide6.QtGui import QPixmap
from PySide6.QtWidgets import (
from PySide2.QtGui import QPixmap
from PySide2.QtWidgets import (
QFrame,
QGridLayout,
QGroupBox,

View File

@@ -1,4 +1,4 @@
from PySide6.QtWidgets import QFrame
from PySide2.QtWidgets import QFrame
class QDebriefingInformation(QFrame):

View File

@@ -1,4 +1,4 @@
from PySide6.QtWidgets import QLabel, QGroupBox, QGridLayout
from PySide2.QtWidgets import QLabel, QGroupBox, QGridLayout
from game import Game

View File

@@ -1,5 +1,5 @@
"""Spin box for selecting the number of aircraft in a flight."""
from PySide6.QtWidgets import QSpinBox
from PySide2.QtWidgets import QSpinBox
class QFlightSizeSpinner(QSpinBox):

View File

@@ -1,6 +1,6 @@
from typing import Optional
from PySide6.QtWidgets import (
from PySide2.QtWidgets import (
QGridLayout,
QGroupBox,
QHBoxLayout,

View File

@@ -1,8 +1,8 @@
"""A layout containing a widget with an associated label."""
from typing import Optional
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QHBoxLayout, QLabel, QWidget
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QHBoxLayout, QLabel, QWidget
class QLabeledWidget(QHBoxLayout):

View File

@@ -1,5 +1,5 @@
from PySide6 import QtCore, QtGui
from PySide6.QtWidgets import QCalendarWidget
from PySide2 import QtCore, QtGui
from PySide2.QtWidgets import QCalendarWidget
class QLiberationCalendar(QCalendarWidget):

View File

@@ -1,6 +1,6 @@
from typing import List, Optional
from PySide6.QtWidgets import (
from PySide2.QtWidgets import (
QDialog,
QFrame,
QGroupBox,

View File

@@ -3,18 +3,18 @@ import logging
from datetime import timedelta
from typing import Optional
from PySide6.QtCore import (
from PySide2.QtCore import (
QItemSelectionModel,
QModelIndex,
QSize,
Qt,
)
from PySide6.QtGui import (
QAction,
from PySide2.QtGui import (
QContextMenuEvent,
)
from PySide6.QtWidgets import (
from PySide2.QtWidgets import (
QAbstractItemView,
QAction,
QGroupBox,
QHBoxLayout,
QLabel,

View File

@@ -1,5 +1,5 @@
"""Widgets for displaying client slots."""
from PySide6.QtWidgets import QLabel
from PySide2.QtWidgets import QLabel
from qt_ui.models import AtoModel
from qt_ui.widgets.QLabeledWidget import QLabeledWidget

View File

@@ -1,7 +1,7 @@
"""Combo box for selecting aircraft types."""
from typing import Iterable, Type
from PySide6.QtWidgets import QComboBox
from PySide2.QtWidgets import QComboBox
from dcs.unittype import FlyingType
from gen.flights.ai_flight_planner_db import aircraft_for_task

View File

@@ -1,7 +1,7 @@
"""Combo box for selecting a departure airfield."""
from typing import Iterable, Optional
from PySide6.QtWidgets import QComboBox
from PySide2.QtWidgets import QComboBox
from dcs.unittype import FlyingType
from game.dcs.aircrafttype import AircraftType

View File

@@ -1,5 +1,5 @@
from PySide6.QtCore import QSortFilterProxyModel, Qt
from PySide6.QtWidgets import QComboBox, QCompleter
from PySide2.QtCore import QSortFilterProxyModel, Qt
from PySide2.QtWidgets import QComboBox, QCompleter
class QFilteredComboBox(QComboBox):

View File

@@ -1,6 +1,6 @@
"""Combo box for selecting a flight's task type."""
from PySide6.QtWidgets import QComboBox
from PySide2.QtWidgets import QComboBox
from game.theater import ConflictTheater, MissionTarget

View File

@@ -1,4 +1,4 @@
from PySide6.QtGui import QStandardItem, QStandardItemModel
from PySide2.QtGui import QStandardItem, QStandardItemModel
from game import Game
from game.theater import ControlPointType, BuildingGroundObject

View File

@@ -1,4 +1,4 @@
from PySide6.QtGui import QStandardItem, QStandardItemModel
from PySide2.QtGui import QStandardItem, QStandardItemModel
from game import Game
from qt_ui.widgets.combos.QFilteredComboBox import QFilteredComboBox

View File

@@ -1,6 +1,6 @@
from typing import Optional
from PySide6.QtWidgets import QSpinBox
from PySide2.QtWidgets import QSpinBox
class FloatSpinner(QSpinBox):

View File

@@ -6,10 +6,10 @@ from typing import (
Optional,
)
from PySide6.QtCore import QUrl
from PySide6.QtWebChannel import QWebChannel
from PySide6.QtWebEngineCore import QWebEnginePage
from PySide6.QtWebEngineWidgets import (
from PySide2.QtCore import QUrl
from PySide2.QtWebChannel import QWebChannel
from PySide2.QtWebEngineWidgets import (
QWebEnginePage,
QWebEngineView,
)
@@ -27,7 +27,6 @@ class LoggingWebPage(QWebEnginePage):
line_number: int,
source: str,
) -> None:
super().javaScriptConsoleMessage(level, message, line_number, source)
if level == QWebEnginePage.JavaScriptConsoleMessageLevel.ErrorMessageLevel:
logging.error(message)
elif level == QWebEnginePage.JavaScriptConsoleMessageLevel.WarningMessageLevel:
@@ -49,11 +48,11 @@ class QLiberationMap(QWebEngineView):
self.channel.registerObject("game", self.map_model)
self.page = LoggingWebPage(self)
self.setPage(self.page)
self.page.setWebChannel(self.channel)
self.page.load(
QUrl.fromLocalFile(str(Path("resources/ui/map/canvas.html").resolve()))
)
self.setPage(self.page)
def set_game(self, game: Optional[Game]) -> None:
if game is None:

View File

@@ -4,7 +4,7 @@ import logging
from datetime import timedelta
from typing import Iterator, List, Optional, Tuple, Union
from PySide6.QtCore import Property, QObject, Signal, Slot
from PySide2.QtCore import Property, QObject, Signal, Slot
from dcs import Point
from dcs.unit import Unit
from dcs.vehicles import vehicle_map
@@ -59,7 +59,7 @@ ENABLE_EXPENSIVE_DEBUG_TOOLS = False
#
# https://bugreports.qt.io/browse/PYSIDE-1426
#
# PySide6 5.15.2 released 6 days before the fix for this was merged, but presumably we
# PySide2 5.15.2 released 6 days before the fix for this was merged, but presumably we
# can clean up after 5.15.3 (or a future version) is released.
#
# Until then, all properties must use a notify signal. For some reason the error doesn't

View File

@@ -2,7 +2,7 @@ from __future__ import annotations
from typing import Optional
from PySide6.QtWidgets import QButtonGroup, QHBoxLayout, QPushButton, QWidget
from PySide2.QtWidgets import QButtonGroup, QHBoxLayout, QPushButton, QWidget
from game.sim.simspeedsetting import SimSpeedSetting
from qt_ui.simcontroller import SimController

View File

@@ -1,9 +1,9 @@
from datetime import timedelta
from typing import Optional
from PySide6 import QtWidgets
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QSlider, QHBoxLayout
from PySide2 import QtWidgets
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QSlider, QHBoxLayout
from qt_ui.widgets.floatspinners import FloatSpinner

View File

@@ -1,7 +1,7 @@
import random
from PySide6.QtGui import QStandardItemModel, QStandardItem
from PySide6.QtWidgets import (
from PySide2.QtGui import QStandardItemModel, QStandardItem
from PySide2.QtWidgets import (
QGroupBox,
QLabel,
QWidget,