aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/serialbus/can/mainwindow.py2
-rw-r--r--examples/serialbus/can/receivedframesmodel.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/serialbus/can/mainwindow.py b/examples/serialbus/can/mainwindow.py
index dda655888..d0fc74fc9 100644
--- a/examples/serialbus/can/mainwindow.py
+++ b/examples/serialbus/can/mainwindow.py
@@ -137,7 +137,7 @@ class MainWindow(QMainWindow):
self.m_ui.actionDeviceInformation.setEnabled(True)
self.m_ui.sendFrameBox.setEnabled(True)
config_bit_rate = self.m_can_device.configurationParameter(QCanBusDevice.BitRateKey)
- if config_bit_rate > 0:
+ if config_bit_rate is not None and config_bit_rate > 0:
is_can_fd = bool(self.m_can_device.configurationParameter(QCanBusDevice.CanFdKey))
config_data_bit_rate = self.m_can_device.configurationParameter(
QCanBusDevice.DataBitRateKey)
diff --git a/examples/serialbus/can/receivedframesmodel.py b/examples/serialbus/can/receivedframesmodel.py
index d9f843a39..d18354e0b 100644
--- a/examples/serialbus/can/receivedframesmodel.py
+++ b/examples/serialbus/can/receivedframesmodel.py
@@ -43,7 +43,7 @@ class ReceivedFramesModel(QAbstractTableModel):
return True
def headerData(self, section, orientation, role):
- if role == Qt.AlignmentFlag.DisplayRole and orientation == Qt.AlignmentFlag.Horizontal:
+ if role == Qt.ItemDataRole.DisplayRole and orientation == Qt.Orientation.Horizontal:
if section == ReceivedFramesModelColumns.number:
return "#"
if section == ReceivedFramesModelColumns.timestamp:
@@ -57,7 +57,7 @@ class ReceivedFramesModel(QAbstractTableModel):
if section == ReceivedFramesModelColumns.data:
return "Data"
- if role == Qt.AlignmentFlag.SizeHintRole and orientation == Qt.AlignmentFlag.Horizontal:
+ if role == Qt.ItemDataRole.SizeHintRole and orientation == Qt.Orientation.Horizontal:
if section == ReceivedFramesModelColumns.number:
return QSize(80, 25)
if section == ReceivedFramesModelColumns.timestamp:
@@ -77,9 +77,9 @@ class ReceivedFramesModel(QAbstractTableModel):
return None
row = index.row()
column = index.column()
- if role == Qt.AlignmentFlag.TextAlignmentRole:
+ if role == Qt.ItemDataRole.TextAlignmentRole:
return column_alignment[index.column()]
- if role == Qt.AlignmentFlag.DisplayRole:
+ if role == Qt.ItemDataRole.AlignmentFlag.DisplayRole:
return self.m_framesQueue[row][column]
if role == clipboard_text_role:
f = self.m_framesQueue[row][column]