Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<author email="mabel@openrobotics.org">Mabel Zhang</author>
<author email="logans@cottsay.net">Scott K Logan</author>

<build_depend>qt6-base-dev</build_depend>
<build_depend>libqt6widgets6t64</build_depend>

<exec_depend>ament_index_python</exec_depend>
<exec_depend version_gte="0.2.19">python_qt_binding</exec_depend>
<exec_depend>python3-matplotlib</exec_depend>
Expand Down
8 changes: 5 additions & 3 deletions src/rqt_plot/data_plot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from python_qt_binding import QT_BINDING
from python_qt_binding.QtCore import Qt, qWarning, Signal
from python_qt_binding.QtGui import QColor
from python_qt_binding.QtGui import QColor, QColorConstants
from python_qt_binding.QtWidgets import QHBoxLayout, QWidget
from qt_gui_py_common.simple_settings_dialog import SimpleSettingsDialog
from rqt_py_common.ini_helper import pack, unpack
Expand Down Expand Up @@ -112,8 +112,10 @@ class DataPlot(QWidget):
SCALE_VISIBLE = 2
SCALE_EXTEND = 4

_colors = [Qt.blue, Qt.red, Qt.cyan, Qt.magenta, Qt.green,
Qt.darkYellow, Qt.black, Qt.darkCyan, Qt.darkRed, Qt.gray]
_colors = [QColorConstants.Blue, QColorConstants.Red, QColorConstants.Cyan,
QColorConstants.Magenta, QColorConstants.Green,
QColorConstants.DarkYellow, QColorConstants.Black,
QColorConstants.DarkCyan, QColorConstants.DarkRed, QColorConstants.Gray]

limits_changed = Signal()
_redraw = Signal()
Expand Down
8 changes: 4 additions & 4 deletions src/rqt_plot/data_plot/mat_data_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as NavigationToolbar
from matplotlib.figure import Figure

from python_qt_binding import QT_BINDING, QT_BINDING_VERSION
from python_qt_binding import QT_BINDING, QT_BINDING_VERSION, QtWidgets

try:
from pkg_resources import parse_version
Expand All @@ -48,7 +48,7 @@ def parse_version(s):
raise ImportError('A PySide version newer than 1.1.0 is required.')

from python_qt_binding.QtCore import Qt, Signal
from python_qt_binding.QtGui import QColor
from python_qt_binding.QtGui import QColorConstants
from python_qt_binding.QtWidgets import QSizePolicy, QVBoxLayout, QWidget

if QT_BINDING == 'pyside':
Expand Down Expand Up @@ -77,7 +77,7 @@ def __init__(self, parent=None):
self.axes = self.figure.add_subplot(111)
self.axes.grid(True, color='gray')
self.safe_tight_layout()
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.setSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding)
self.updateGeometry()

def resizeEvent(self, event):
Expand Down Expand Up @@ -120,7 +120,7 @@ def __init__(self, parent=None):
def _limits_changed(self, event):
self.limits_changed.emit()

def add_curve(self, curve_id, curve_name, curve_color=QColor(Qt.blue), markers_on=False):
def add_curve(self, curve_id, curve_name, curve_color=QColorConstants.Blue, markers_on=False):

# adding an empty curve and change the limits, so save and restore them
x_limits = self.get_xlim()
Expand Down
6 changes: 3 additions & 3 deletions src/rqt_plot/data_plot/pyqtgraph_data_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from pyqtgraph import mkBrush, mkPen, PlotWidget

from python_qt_binding.QtCore import Qt, Signal
from python_qt_binding.QtGui import QColor
from python_qt_binding.QtGui import QColorConstants
from python_qt_binding.QtWidgets import QVBoxLayout, QWidget

try:
Expand Down Expand Up @@ -71,10 +71,10 @@ def __init__(self, parent=None):
self._curves = {}
self._current_vline = None

def add_curve(self, curve_id, curve_name, curve_color=QColor(Qt.blue), markers_on=False):
def add_curve(self, curve_id, curve_name, curve_color=QColorConstants.Blue, markers_on=False):
pen = mkPen(curve_color, width=1)
symbol = 'o'
symbolPen = mkPen(QColor(Qt.black))
symbolPen = mkPen(QColor(QColorConstants.Black))
symbolBrush = mkBrush(curve_color)
# this adds the item to the plot and legend
if markers_on:
Expand Down
8 changes: 4 additions & 4 deletions src/rqt_plot/data_plot/qwt_data_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import sys

from python_qt_binding.QtCore import QEvent, QPointF, QSize, Qt, qWarning, Signal
from python_qt_binding.QtGui import QBrush, QColor, QPen, QVector2D
from python_qt_binding.QtGui import QBrush, QColorConstants, QPen, QVector2D
import Qwt


Expand Down Expand Up @@ -75,8 +75,8 @@ def __init__(self, *args):
Qwt.QwtPlot.xBottom, Qwt.QwtPlot.yLeft, Qwt.QwtPicker.PolygonSelection,
Qwt.QwtPlotPicker.PolygonRubberBand, Qwt.QwtPicker.AlwaysOn, self.canvas()
)
self._picker.setRubberBandPen(QPen(Qt.blue))
self._picker.setTrackerPen(QPen(Qt.blue))
self._picker.setRubberBandPen(QPen(QColorConstants.Blue))
self._picker.setTrackerPen(QPen(QColorConstants.Blue))

# Initialize data
self.rescale()
Expand Down Expand Up @@ -114,7 +114,7 @@ def resizeEvent(self, event):
Qwt.QwtPlot.resizeEvent(self, event)
self.rescale()

def add_curve(self, curve_id, curve_name, curve_color=QColor(Qt.blue), markers_on=False):
def add_curve(self, curve_id, curve_name, curve_color=QColorConstants.Blue, markers_on=False):
curve_id = str(curve_id)
if curve_id in self._curves:
return
Expand Down
10 changes: 8 additions & 2 deletions src/rqt_plot/plot_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,15 @@

from ament_index_python.resources import get_resource
from python_qt_binding import loadUi
from python_qt_binding import QT_BINDING_VERSION
from python_qt_binding.QtCore import Qt, QTimer, qWarning, Slot
from python_qt_binding.QtGui import QIcon
from python_qt_binding.QtWidgets import QAction, QMenu, QWidget
from packaging.version import Version
if Version(QT_BINDING_VERSION) > Version("6.0.0"):
from python_qt_binding.QtGui import QIcon, QAction
from python_qt_binding.QtWidgets import QMenu, QWidget
else:
from python_qt_binding.QtGui import QIcon
from python_qt_binding.QtWidgets import QAction, QMenu, QWidget

from rosidl_parser.definition import AbstractGenericString
from rosidl_parser.definition import AbstractNestedType
Expand Down