I create this widget while making a GUI at work. I was trying to find any open-source battery widget but could not find one. Sharing this fix size widget won't help much but hope for someone was looking for a quick one like me.
- If you're using Qt Designer, promot your widget to
BatteryWidget
- Copy
batterywidget.py
to your main directory - To set the battery value use:
self.yourUIbatteryWidgetName.setValue(value) # between 0 - 100, percentage
- This widget is fix size, you can resize in
batterywidget.py
- Feel free to update and republish it, maybe make it responsive.