asteroid
asteroid copied to clipboard
Write the app by Python
Hello! I try to use PyQt5 in AsteroidOS (@MagneFire build the package) and It's worked! I think It's possible to write app by python code + pyqt5.
package requirements
- python3-pyqt5
- sip3
- qtbase
- qtbase-plugins
All packages needs to installed by opkg install --force-reinstall *
How to run
use ceres
user by su ceres
and run python by QT_QPA_PLATFORM=wayland EGL_PLATFORM=wayland QT_WAYLAND_DISABLE_WINDOWDECORATION=1 python3 testqt.py
testqt.py
# Code by https://pythonbasics.org/pyqt-hello-world/
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QLabel
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import pyqtSlot
def window():
app = QApplication(sys.argv)
widget = QWidget()
textLabel = QLabel(widget)
textLabel.setText("Hello World!")
textLabel.move(110,85)
widget.setGeometry(50,50,320,200)
widget.setWindowTitle("PyQt5 Example")
widget.show()
sys.exit(app.exec_())
if __name__ == '__main__':
window()
@Doomsdayrs think it should use AsteroidOS's QML components. https://github.com/AsteroidOS/qml-asteroid
It want to help someone to write the QML components wrapper for python.
I found https://forum.qt.io/topic/112887/pyside2-pyqt5-using-qpluginloader-to-import-a-qt-c-plugin/3. It's maybe use pyqt5 with AsteroidOS's QML components.