From a5fb0e97129c619fa4d2df7c6194cc6d06a1a8bd Mon Sep 17 00:00:00 2001 From: girvile Date: Wed, 10 May 2023 12:26:11 +0200 Subject: [PATCH 1/3] Update toggle.py change QPoint to QPointF for moveCenter(QRectF) function --- qtwidgets/toggle/toggle.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qtwidgets/toggle/toggle.py b/qtwidgets/toggle/toggle.py index f13217c..d77c557 100644 --- a/qtwidgets/toggle/toggle.py +++ b/qtwidgets/toggle/toggle.py @@ -162,7 +162,8 @@ def paintEvent(self, e: QPaintEvent): 0, 0, contRect.width() - handleRadius, 0.40 * contRect.height() ) - barRect.moveCenter(contRect.center()) + constRectCentered = constRect.center() + barRect.moveCenter(constRectCentered.toPointF()) rounding = barRect.height() / 2 # the handle will move along this line From 00c2e67a068afce25f22fb2f1d276417a4a91a60 Mon Sep 17 00:00:00 2001 From: girvile Date: Wed, 10 May 2023 13:59:43 +0200 Subject: [PATCH 2/3] Update colorbutton.py --- qtwidgets/colorbutton/colorbutton.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/qtwidgets/colorbutton/colorbutton.py b/qtwidgets/colorbutton/colorbutton.py index 9d3ac1c..0998eaf 100644 --- a/qtwidgets/colorbutton/colorbutton.py +++ b/qtwidgets/colorbutton/colorbutton.py @@ -1,15 +1,9 @@ import sys -if 'PyQt5' in sys.modules: - from PyQt5 import QtCore, QtGui, QtWidgets - from PyQt5.QtCore import Qt, pyqtSignal as Signal +from qtpy.QtCore import Signal +from qtpy.QtWidgets import QPushButton -else: - from PySide2 import QtCore, QtGui, QtWidgets - from PySide2.QtCore import Qt, Signal - - -class ColorButton(QtWidgets.QPushButton): +class ColorButton(QPushButton): ''' Custom Qt Widget to show a chosen color. From ed427b3c216989220af77892c22294afd0d5a58f Mon Sep 17 00:00:00 2001 From: girvile Date: Wed, 10 May 2023 14:01:25 +0200 Subject: [PATCH 3/3] Update toggle.py --- qtwidgets/toggle/toggle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qtwidgets/toggle/toggle.py b/qtwidgets/toggle/toggle.py index d77c557..a1fa1e5 100644 --- a/qtwidgets/toggle/toggle.py +++ b/qtwidgets/toggle/toggle.py @@ -162,8 +162,8 @@ def paintEvent(self, e: QPaintEvent): 0, 0, contRect.width() - handleRadius, 0.40 * contRect.height() ) - constRectCentered = constRect.center() - barRect.moveCenter(constRectCentered.toPointF()) + contRectCentered = contRect.center() + barRect.moveCenter(contRectCentered.toPointF()) rounding = barRect.height() / 2 # the handle will move along this line