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,4 +1,4 @@
|
||||
from PySide2.QtWidgets import QHBoxLayout, QGroupBox, QPushButton
|
||||
from PySide6.QtWidgets import QHBoxLayout, QGroupBox, QPushButton
|
||||
|
||||
import qt_ui.uiconstants as CONST
|
||||
from game import Game
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
|
||||
from PySide2.QtGui import QPixmap
|
||||
from PySide2.QtWidgets import (
|
||||
from PySide6.QtGui import QPixmap
|
||||
from PySide6.QtWidgets import (
|
||||
QFrame,
|
||||
QGridLayout,
|
||||
QGroupBox,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from PySide2.QtWidgets import QFrame
|
||||
from PySide6.QtWidgets import QFrame
|
||||
|
||||
|
||||
class QDebriefingInformation(QFrame):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from PySide2.QtWidgets import QLabel, QGroupBox, QGridLayout
|
||||
from PySide6.QtWidgets import QLabel, QGroupBox, QGridLayout
|
||||
|
||||
from game import Game
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Spin box for selecting the number of aircraft in a flight."""
|
||||
from PySide2.QtWidgets import QSpinBox
|
||||
from PySide6.QtWidgets import QSpinBox
|
||||
|
||||
|
||||
class QFlightSizeSpinner(QSpinBox):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from PySide2.QtCore import Signal
|
||||
from PySide2.QtWidgets import (
|
||||
from PySide6.QtCore import Signal
|
||||
from PySide6.QtWidgets import (
|
||||
QHBoxLayout,
|
||||
QLabel,
|
||||
QPushButton,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from PySide2.QtWidgets import (
|
||||
from PySide6.QtWidgets import (
|
||||
QHBoxLayout,
|
||||
QLabel,
|
||||
QPushButton,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from PySide2.QtWidgets import (
|
||||
from PySide6.QtWidgets import (
|
||||
QGridLayout,
|
||||
QGroupBox,
|
||||
QHBoxLayout,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
"""A layout containing a widget with an associated label."""
|
||||
from typing import Optional
|
||||
|
||||
from PySide2.QtCore import Qt
|
||||
from PySide2.QtWidgets import QHBoxLayout, QLabel, QWidget
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtWidgets import QHBoxLayout, QLabel, QWidget
|
||||
|
||||
|
||||
class QLabeledWidget(QHBoxLayout):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from PySide2 import QtCore, QtGui
|
||||
from PySide2.QtWidgets import QCalendarWidget
|
||||
from PySide6 import QtCore, QtGui
|
||||
from PySide6.QtWidgets import QCalendarWidget
|
||||
|
||||
|
||||
class QLiberationCalendar(QCalendarWidget):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from PySide2.QtCore import Signal
|
||||
from PySide2.QtWidgets import (
|
||||
from PySide6.QtCore import Signal
|
||||
from PySide6.QtWidgets import (
|
||||
QHBoxLayout,
|
||||
QLabel,
|
||||
QPushButton,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from PySide2.QtWidgets import (
|
||||
from PySide6.QtWidgets import (
|
||||
QHBoxLayout,
|
||||
QLabel,
|
||||
QPushButton,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from datetime import datetime
|
||||
from typing import List, Optional
|
||||
|
||||
from PySide2.QtWidgets import (
|
||||
from PySide6.QtWidgets import (
|
||||
QDialog,
|
||||
QFrame,
|
||||
QGroupBox,
|
||||
|
||||
@@ -2,18 +2,17 @@
|
||||
import logging
|
||||
from typing import Optional
|
||||
|
||||
from PySide2.QtCore import (
|
||||
from PySide6.QtCore import (
|
||||
QItemSelectionModel,
|
||||
QModelIndex,
|
||||
QSize,
|
||||
Qt,
|
||||
)
|
||||
from PySide2.QtGui import (
|
||||
QContextMenuEvent,
|
||||
from PySide6.QtGui import (
|
||||
QContextMenuEvent, QAction,
|
||||
)
|
||||
from PySide2.QtWidgets import (
|
||||
from PySide6.QtWidgets import (
|
||||
QAbstractItemView,
|
||||
QAction,
|
||||
QGroupBox,
|
||||
QHBoxLayout,
|
||||
QLabel,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Widgets for displaying client slots."""
|
||||
from PySide2.QtWidgets import QLabel
|
||||
from PySide6.QtWidgets import QLabel
|
||||
|
||||
from qt_ui.models import AtoModel
|
||||
from qt_ui.widgets.QLabeledWidget import QLabeledWidget
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""Combo box for selecting aircraft types."""
|
||||
from PySide2.QtWidgets import QComboBox
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
|
||||
from game.dcs.aircrafttype import AircraftType
|
||||
|
||||
@@ -11,7 +11,7 @@ class QAircraftTypeSelector(QComboBox):
|
||||
super().__init__()
|
||||
|
||||
self.model().sort(0)
|
||||
self.setSizeAdjustPolicy(self.AdjustToContents)
|
||||
self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToContents)
|
||||
self.update_items(aircraft_types)
|
||||
|
||||
def update_items(self, aircraft_types: list[AircraftType]):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"""Combo box for selecting a departure airfield."""
|
||||
from typing import Iterable, Optional
|
||||
|
||||
from PySide2.QtWidgets import QComboBox
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
from dcs.unittype import FlyingType
|
||||
|
||||
from game.dcs.aircrafttype import AircraftType
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from PySide2.QtCore import QSortFilterProxyModel, Qt
|
||||
from PySide2.QtWidgets import QComboBox, QCompleter
|
||||
from PySide6.QtCore import QSortFilterProxyModel, Qt
|
||||
from PySide6.QtWidgets import QComboBox, QCompleter
|
||||
|
||||
|
||||
class QFilteredComboBox(QComboBox):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Combo box for selecting a flight's task type."""
|
||||
|
||||
from PySide2.QtWidgets import QComboBox
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
|
||||
from game.ato.flighttype import FlightType
|
||||
from game.settings.settings import Settings
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from PySide2.QtGui import QStandardItem, QStandardItemModel
|
||||
from PySide6.QtGui import QStandardItem, QStandardItemModel
|
||||
|
||||
from game import Game
|
||||
from game.ato.flightwaypoint import FlightWaypoint
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
|
||||
from PySide2.QtWidgets import QComboBox
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
|
||||
from game.squadrons import Squadron
|
||||
|
||||
@@ -13,7 +13,7 @@ class SquadronLiverySelector(QComboBox):
|
||||
|
||||
def __init__(self, squadron: Squadron) -> None:
|
||||
super().__init__()
|
||||
self.setSizeAdjustPolicy(self.AdjustToContents)
|
||||
self.setSizeAdjustPolicy(QComboBox.SizeAdjustPolicy.AdjustToContents)
|
||||
|
||||
self.aircraft_type = squadron.aircraft
|
||||
selected_livery = squadron.livery
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from PySide2.QtWidgets import QComboBox
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
|
||||
from game.ato import FlightType
|
||||
from game.dcs.aircrafttype import AircraftType
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from typing import Optional
|
||||
|
||||
from PySide2.QtWidgets import QSpinBox
|
||||
from PySide6.QtWidgets import QSpinBox
|
||||
|
||||
|
||||
class FloatSpinner(QSpinBox):
|
||||
|
||||
@@ -3,10 +3,9 @@ from __future__ import annotations
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
from PySide2.QtCore import QUrl
|
||||
from PySide2.QtWebEngineWidgets import (
|
||||
QWebEnginePage,
|
||||
QWebEngineSettings,
|
||||
from PySide6.QtCore import QUrl
|
||||
from PySide6.QtWebEngineCore import QWebEnginePage, QWebEngineSettings
|
||||
from PySide6.QtWebEngineWidgets import (
|
||||
QWebEngineView,
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from PySide2.QtWidgets import QButtonGroup, QHBoxLayout, QPushButton, QWidget
|
||||
from PySide6.QtWidgets import QButtonGroup, QHBoxLayout, QPushButton, QWidget
|
||||
|
||||
from game.sim.simspeedsetting import SimSpeedSetting
|
||||
from qt_ui.simcontroller import SimController
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from datetime import timedelta
|
||||
from typing import Optional
|
||||
|
||||
from PySide2 import QtWidgets
|
||||
from PySide2.QtCore import Qt
|
||||
from PySide2.QtWidgets import QSlider, QHBoxLayout
|
||||
from PySide6 import QtWidgets
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtWidgets import QSlider, QHBoxLayout
|
||||
|
||||
from qt_ui.widgets.floatspinners import FloatSpinner
|
||||
|
||||
|
||||
Reference in New Issue
Block a user