aboutsummaryrefslogtreecommitdiffstats
path: root/extras
diff options
context:
space:
mode:
authorSuchinton <suchinton.2001@gmail.com>2024-06-02 21:44:04 +0530
committerSuchinton <suchinton.2001@gmail.com>2024-06-24 00:06:49 +0530
commitb742c6d5b26c036addb2922e36d06dbea35c10f1 (patch)
tree36b6c2349e5b6ce93de40884c9d62bae442bb410 /extras
parent31573c88e0ddefc3591bb7752b306601554ebbf2 (diff)
Port AGL Demo Control Panel to Qt6
This commit includes the following changes: V1: - Migrated from PyQt5 to PyQt6/PySide6 with minor syntax adjustments. - Removed the dependency on qtwidgets and extracted only the required animated toggle module, patching it to work with PyQt6. - Updated the README to include new steps for compiling resources. - Bumped QtPy from version 2.3.1 to 2.4.1 V2: - Refactored set_icon function in Dashboard module to make use of QIcon directly instead of using the QtSvg library (Invalid in PyQt6) - Syntax changes in UI_Handeler to use PyQt6 V3: - Update gitignore - Remove dependency on qtpy V4: - Added new animated toggle button - Refactored ICPage and Settings to use new toggle - Updated Navigation Bar Animation to have Bounce effect using "OutBounce" QEasingCurve Bug-AGL: SPEC-5161 Change-Id: I44499bb5165d5794af7e9aae3407ffae1f7e1928 Signed-off-by: Suchinton <suchinton.2001@gmail.com>
Diffstat (limited to 'extras')
-rw-r--r--extras/KuksaClient.py6
-rw-r--r--extras/UI_Handeler.py22
-rw-r--r--extras/VehicleSimulator.py2
3 files changed, 15 insertions, 15 deletions
diff --git a/extras/KuksaClient.py b/extras/KuksaClient.py
index 504e21c..772fd50 100644
--- a/extras/KuksaClient.py
+++ b/extras/KuksaClient.py
@@ -4,8 +4,8 @@
# SPDX-License-Identifier: Apache-2.0
import logging
-from PyQt5.QtCore import QThread
-from PyQt5.QtCore import pyqtSignal
+from PyQt6.QtCore import QThread
+from PyQt6.QtCore import pyqtSignal
from . import Kuksa_Instance as kuksa_instance
import threading
@@ -103,7 +103,7 @@ class KuksaClient(QThread):
logging.error(f"Error sending values to kuksa {e}")
threading.Thread(target=self.set_instance).start()
- def setValues(self, values : dict[str, any] = None):
+ def setValues(self, values: dict[str, any] = None):
"""
Sets VSS values.
diff --git a/extras/UI_Handeler.py b/extras/UI_Handeler.py
index 05a351d..911f5ff 100644
--- a/extras/UI_Handeler.py
+++ b/extras/UI_Handeler.py
@@ -15,16 +15,16 @@
"""
from main import *
-from PyQt5 import QtCore
-from PyQt5.QtCore import QPropertyAnimation
-from PyQt5.QtWidgets import QWidget
-from PyQt5.QtCore import QEasingCurve
-from PyQt5.QtWidgets import QGraphicsOpacityEffect
+from PyQt6 import QtCore
+from PyQt6.QtCore import QPropertyAnimation
+from PyQt6.QtWidgets import QWidget
+from PyQt6.QtCore import QEasingCurve
+from PyQt6.QtWidgets import QGraphicsOpacityEffect
from kuksa_client.grpc import Field, SubscribeEntry, View
from kuksa_client.grpc.aio import VSSClient
-from PyQt5.QtCore import pyqtSignal
+from PyQt6.QtCore import pyqtSignal
+from PyQt6.QtCore import QThread
import asyncio
-from PyQt5.QtCore import QThread
import pathlib
import logging
import json
@@ -91,7 +91,7 @@ class UI_Handeler(MainWindow):
def fullscreen(self):
self.headerContainer.hide()
- self.setAttribute(QtCore.Qt.WA_TranslucentBackground, False)
+ self.setAttribute(QtCore.Qt.WidgetAttribute.WA_TranslucentBackground, False)
self.showFullScreen()
def block_updates():
@@ -117,7 +117,7 @@ class UI_Handeler(MainWindow):
self.animation.setDuration(400)
self.animation.setStartValue(height)
self.animation.setEndValue(heightExtended)
- self.animation.setEasingCurve(QtCore.QEasingCurve.InOutQuart)
+ self.animation.setEasingCurve(QtCore.QEasingCurve.Type.OutBounce)
self.animation.start()
def animateSwitch(self, index):
@@ -313,10 +313,10 @@ class FaderWidget(QWidget):
self.new_widget.setGraphicsEffect(self.effect)
self.animation = QPropertyAnimation(self.effect, b"opacity")
- self.animation.setDuration(300)
+ self.animation.setDuration(200)
self.animation.setStartValue(0)
self.animation.setEndValue(1)
- self.animation.setEasingCurve(QEasingCurve.OutCubic)
+ self.animation.setEasingCurve(QEasingCurve.Type.InCubic)
self.animation.finished.connect(self.close)
self.animate()
diff --git a/extras/VehicleSimulator.py b/extras/VehicleSimulator.py
index cf790d2..da4bd9e 100644
--- a/extras/VehicleSimulator.py
+++ b/extras/VehicleSimulator.py
@@ -8,7 +8,7 @@ import math
import random
import time
import threading
-from PyQt5.QtCore import QObject, pyqtSignal
+from PyQt6.QtCore import QObject, pyqtSignal
from extras.KuksaClient import KuksaClient
class VehicleSimulator(QObject):