As of now, I am using my Windows 8 laptop to download and try stuff because the pi is ridiculously slow. I also have a small keyboard w/touch pad for the pi that sucks to do any real typing on. My pi only has 2 usb ports and the wifi port takes one of them...
I have Qt Creator, which seems good for QML, Qt, and C++. Python seems like an after thought... I will try to import my PyQt stuff into that. As of now I am using Python IDLE, which sucks for auto generating code options. I was able to get a Pythin GUI app to open the QML Gauges.
The main thing I am working on now is decoding the pyobd code to only read values I care about, removing the crappy squares with paged data (an array of 6 parameters at a time), and to append those values to the Python/Qt GUI. My biggest problem right now is trying to set the "currentValue" parameter of the QML gauges with Python. I just don't know how to access the QML parameters yet to modify them. I was happy to actually get the QML to load from Python today though.
Here is the code for that (main.qml is the primary QML file for the Gauges). This is pretty straight forward, knowing what version of Python and PyQT are compatible, and installing in the correct order to get everything working was more of a challenge... I used Python 3.4, 32 bit, because supposedly 64 bit isn't compatible with PyQt5 which is what I am using.
Code: Select all
import sys
from PyQt5.QtCore import QUrl, QObject
from PyQt5.QtWidgets import QApplication
from PyQt5.QtQuick import QQuickView
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtQml import QQmlApplicationEngine
# Main Function
if __name__ == '__main__':
# Create main app
myApp = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine(QUrl("main.qml"))
window = engine.rootObjects()[0]
window.show()
sys.exit(myApp.exec_())
# Execute the Application and Exit
myApp.exec_()
sys.exit()