diff --git a/source/frontend/carla_settings.py b/source/frontend/carla_settings.py index 0ba50583f..7ab91a5ab 100755 --- a/source/frontend/carla_settings.py +++ b/source/frontend/carla_settings.py @@ -20,7 +20,7 @@ # Imports (Global) from PyQt5.QtCore import pyqtSlot, QByteArray, QDir, QSettings -from PyQt5.QtGui import QColor, QCursor, QFontMetrics, QPainter, QPainterPath +from PyQt5.QtGui import QColor, QCursor, QPainter, QPainterPath from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QFrame, QInputDialog, QLineEdit, QMenu, QVBoxLayout, QWidget # ------------------------------------------------------------------------------------------------------------ @@ -233,7 +233,7 @@ class CarlaSettingsW(QDialog): # ---------------------------------------------------------------------------------------------------- # Set-up GUI - self.ui.lw_page.setFixedWidth(48 + 6*3 + QFontMetrics(self.ui.lw_page.font()).width(" Experimental ")) + self.ui.lw_page.setFixedWidth(48 + 6*3 + self.ui.lw_page.fontMetrics().width(" Experimental ")) for i in range(host.get_engine_driver_count()): self.ui.cb_engine_audio_driver.addItem(host.get_engine_driver_name(i)) diff --git a/source/frontend/carla_widgets.py b/source/frontend/carla_widgets.py index 949fa6345..5fbfc3c5e 100755 --- a/source/frontend/carla_widgets.py +++ b/source/frontend/carla_widgets.py @@ -881,7 +881,7 @@ class PluginEdit(QDialog): # Get width values, in packs of 20 if parameter['type'] == PARAMETER_INPUT: - paramInputWidthTMP = QFontMetrics(self.font()).width(parameter['name']) + paramInputWidthTMP = self.fontMetrics().width(parameter['name']) if paramInputWidthTMP > paramInputWidth: paramInputWidth = paramInputWidthTMP @@ -894,7 +894,7 @@ class PluginEdit(QDialog): paramInputWidth = 0 else: - paramOutputWidthTMP = QFontMetrics(self.font()).width(parameter['name']) + paramOutputWidthTMP = self.fontMetrics().width(parameter['name']) if paramOutputWidthTMP > paramOutputWidth: paramOutputWidth = paramOutputWidthTMP