mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Migrate to PySide6
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
from collections import defaultdict
|
||||
from typing import Iterable, Iterator, Optional
|
||||
|
||||
from PySide2.QtCore import (
|
||||
from PySide6.QtCore import (
|
||||
QItemSelection,
|
||||
QItemSelectionModel,
|
||||
QSize,
|
||||
Qt,
|
||||
Signal,
|
||||
)
|
||||
from PySide2.QtGui import QIcon, QStandardItem, QStandardItemModel
|
||||
from PySide2.QtWidgets import (
|
||||
from PySide6.QtGui import QIcon, QStandardItem, QStandardItemModel
|
||||
from PySide6.QtWidgets import (
|
||||
QComboBox,
|
||||
QDialog,
|
||||
QGroupBox,
|
||||
@@ -109,7 +109,7 @@ class SquadronBaseSelector(QComboBox):
|
||||
aircraft_type: Optional[AircraftType],
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.setSizeAdjustPolicy(self.AdjustToContents)
|
||||
self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToContents)
|
||||
self.bases = list(bases)
|
||||
self.set_aircraft_type(aircraft_type)
|
||||
|
||||
@@ -812,7 +812,7 @@ class SquadronAircraftTypeSelector(QComboBox):
|
||||
self, types: set[AircraftType], selected_aircraft: Optional[str]
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.setSizeAdjustPolicy(self.AdjustToContents)
|
||||
self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToContents)
|
||||
|
||||
for type in sorted(types, key=lambda type: type.display_name):
|
||||
self.addItem(type.display_name, type)
|
||||
@@ -829,7 +829,7 @@ class SquadronDefSelector(QComboBox):
|
||||
allow_random: bool = True,
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.setSizeAdjustPolicy(self.AdjustToContents)
|
||||
self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToContents)
|
||||
self.squadron_defs = squadron_defs
|
||||
self.allow_random = allow_random
|
||||
self.set_aircraft_type(aircraft)
|
||||
|
||||
Reference in New Issue
Block a user