Fix unit details screen for Qt6.

The `setMargin` shorthand was apparently to simple, so Qt6 removed it in
favor of `setContentMargins`, which does the same thing?

Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2784.
This commit is contained in:
Dan Albert 2023-04-15 13:33:34 -07:00
parent 28ba100864
commit d1fe267072

View File

@ -2,20 +2,14 @@ from __future__ import annotations
from PySide6.QtCore import Qt from PySide6.QtCore import Qt
from PySide6.QtGui import QIcon from PySide6.QtGui import QIcon
from PySide6.QtWidgets import ( from PySide6.QtWidgets import QDialog, QFrame, QGridLayout, QLabel, QTextBrowser
QDialog,
QGridLayout,
QLabel,
QTextBrowser,
QFrame,
)
import game.ato.ai_flight_planner_db import game.ato.ai_flight_planner_db
from game.ato.flighttype import FlightType
from game.dcs.aircrafttype import AircraftType from game.dcs.aircrafttype import AircraftType
from game.dcs.groundunittype import GroundUnitType from game.dcs.groundunittype import GroundUnitType
from game.dcs.unittype import UnitType from game.dcs.unittype import UnitType
from game.game import Game from game.game import Game
from game.ato.flighttype import FlightType
from qt_ui.uiconstants import AIRCRAFT_BANNERS, VEHICLE_BANNERS from qt_ui.uiconstants import AIRCRAFT_BANNERS, VEHICLE_BANNERS
@ -53,7 +47,7 @@ class QUnitInfoWindow(QDialog):
# Build the topmost details grid. # Build the topmost details grid.
self.details_grid = QFrame() self.details_grid = QFrame()
self.details_grid_layout = QGridLayout() self.details_grid_layout = QGridLayout()
self.details_grid_layout.setMargin(0) self.details_grid_layout.setContentsMargins(0, 0, 0, 0)
self.name_box = QLabel( self.name_box = QLabel(
f"<b>Name:</b> {unit_type.manufacturer} {unit_type.name}" f"<b>Name:</b> {unit_type.manufacturer} {unit_type.name}"