Commit a0fcd5cd authored by Tijmen de Mes's avatar Tijmen de Mes

Fixed python >= 3.10 warnings

parent aa2432b2
...@@ -2174,7 +2174,7 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin): ...@@ -2174,7 +2174,7 @@ class ChatWindow(base_class, ui_class, ColorHelperMixin):
self._EH_ShowSessions() self._EH_ShowSessions()
elif watched is self.state_label: elif watched is self.state_label:
if event_type == QEvent.MouseButtonRelease and event.button() == Qt.LeftButton and event.modifiers() == Qt.NoModifier: if event_type == QEvent.MouseButtonRelease and event.button() == Qt.LeftButton and event.modifiers() == Qt.NoModifier:
upper_half = QRect(0, 0, int(self.state_label.width()), int(self.state_label.height()/2)) upper_half = QRect(0, 0, int(self.state_label.width()), int(self.state_label.height() / 2))
if upper_half.contains(event.pos()): if upper_half.contains(event.pos()):
self._EH_CloseSession() self._EH_CloseSession()
else: else:
......
...@@ -4819,7 +4819,7 @@ class ConferenceParticipantDelegate(QStyledItemDelegate, ColorHelperMixin): ...@@ -4819,7 +4819,7 @@ class ConferenceParticipantDelegate(QStyledItemDelegate, ColorHelperMixin):
def editorEvent(self, event, model, option, index): def editorEvent(self, event, model, option, index):
if event.type() == QEvent.MouseButtonRelease and event.button() == Qt.LeftButton and event.modifiers() == Qt.NoModifier: if event.type() == QEvent.MouseButtonRelease and event.button() == Qt.LeftButton and event.modifiers() == Qt.NoModifier:
cross_rect = option.rect.adjusted(option.rect.width() - 14, 0, 0, -option.rect.height() / 2) # top half of the rightmost 14 pixels cross_rect = option.rect.adjusted(int(option.rect.width()) - 14, 0, 0, int(-option.rect.height() / 2)) # top half of the rightmost 14 pixels
if cross_rect.contains(event.pos()): if cross_rect.contains(event.pos()):
item = index.data(Qt.UserRole) item = index.data(Qt.UserRole)
model.session.server_conference.remove_participant(item.participant) model.session.server_conference.remove_participant(item.participant)
...@@ -4882,12 +4882,12 @@ class ConferenceParticipantDelegate(QStyledItemDelegate, ColorHelperMixin): ...@@ -4882,12 +4882,12 @@ class ConferenceParticipantDelegate(QStyledItemDelegate, ColorHelperMixin):
painter.translate(+1.5, +1) painter.translate(+1.5, +1)
painter.translate(0, +1) painter.translate(0, +1)
painter.setPen(contrast_pen) painter.setPen(contrast_pen)
painter.drawLine(-3.5, -3.5, 3.5, 3.5) painter.drawLine(-3, -3, 3, 3)
painter.drawLine(-3.5, 3.5, 3.5, -3.5) painter.drawLine(-3, 3, 3, -3)
painter.translate(0, -1) painter.translate(0, -1)
painter.setPen(pen) painter.setPen(pen)
painter.drawLine(-3.5, -3.5, 3.5, 3.5) painter.drawLine(-3, -3, 3, 3)
painter.drawLine(-3.5, 3.5, 3.5, -3.5) painter.drawLine(-3, 3, 3, -3)
painter.restore() painter.restore()
def sizeHint(self, option, index): def sizeHint(self, option, index):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment