From 84aab752e4e78a300625e96d82c2b97d73275fc9 Mon Sep 17 00:00:00 2001 From: Zach Domke Date: Tue, 17 Dec 2024 15:26:17 -0800 Subject: [PATCH] DEP: Remove references to deprecated QVariant --- pydm/widgets/archiver_time_plot_editor.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pydm/widgets/archiver_time_plot_editor.py b/pydm/widgets/archiver_time_plot_editor.py index d7972a6a1..eb3a8b1a6 100644 --- a/pydm/widgets/archiver_time_plot_editor.py +++ b/pydm/widgets/archiver_time_plot_editor.py @@ -1,7 +1,7 @@ from typing import Any, Optional from qtpy.QtCore import Qt, QModelIndex, QObject from qtpy.QtGui import QColor -from .archiver_time_plot import ArchivePlotCurveItem, FormulaCurveItem +from .archiver_time_plot import ArchivePlotCurveItem from .baseplot import BasePlot, BasePlotCurveItem from .baseplot_table_model import BasePlotCurvesModel from .baseplot_curve_editor import BasePlotCurveEditorDialog, PlotStyleColumnDelegate @@ -39,15 +39,13 @@ def data(self, index, role=Qt.DisplayRole): def get_data(self, column_name: str, curve: BasePlotCurveItem) -> Any: """Get data for the input column name""" if column_name == "Channel": - if isinstance(curve, FormulaCurveItem): - if curve.formula is None: - return "" - return str(curve.formula) + if hasattr(curve, "address"): + return curve.address + elif hasattr(curve, "formula"): + return curve.formula # We are either a Formula or a PV (for now at leasts) else: - if curve.address is None: - return "" - return str(curve.address) + return None elif column_name == "Live Data": return bool(curve.liveData)