Code Monkey home page Code Monkey logo

qled's Introduction

QLed

PyPI version

An LED Widget for the PyQt4/5 Framework

QLed Test Screenshot

Installation

pip

$ pip install QLed

setup.py

Download or clone this repository and then run

$ python setup.py install

Usage

from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout
from QLed import QLed

class Widget(QWidget):
    def __init__(self ,parent=None, **kwargs):
        super().__init__(parent, **kwargs)
        
        l=QVBoxLayout(self)
        self._led=QLed(self, onColour=QLed.Red, shape=QLed.Circle)
        self._led.value=True
        l.addWidget(self._led)
        
if __name__=="__main__":
    from sys import argv, exit
    
    a=QApplication(argv)
    w=Widget()
    w.show()
    exit(a.exec_())

The simple example above creates a single, circular LED that is red in colour when on.

The available shapes are:

  • Circle
  • Round
  • Square
  • Triangle

The available colours are:

  • Red
  • Green
  • Yellow
  • Grey
  • Orange
  • Purple
  • Blue

The LED is switched on and off by settings the boolean value property (either directly or via the setter function setValue(bool)).

Dependencies

  • PyQt4/5
  • six

Tested Platforms/Versions

This module has been tested (recently) with the following configurations

  • macOS 10.12.6 Sierra, Python 3.6, PyQt5.9, Qt5.9.1, sip 4.19.3
  • Ubuntu 16.04LTS, Python 2.7.12, PyQt4.11.4, Qt4.8.7, sip 4.17

qled's People

Contributors

jazzycamel avatar pxe-la avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qled's Issues

C++ port

Hi-

I just ported your QLed to C++. Do you care having it in your repo here? Or should create my own? Either way is fine with me.

New Colors

First of all, thanks for the work! It's a great widget.

So I forked your repo a couple days ago and modified the colors except yellow. You may use them if you would ever thinking about looking for new colors.

colours = {Red:    (0xFF, 0x00, 0x00),
           Green : (0x87, 0xD7, 0x00),
           Yellow: (0xd2, 0xcd, 0x00),
           Grey  : (0x26, 0x26, 0x26),
           Orange: (0xFF, 0x9F, 0x00),
           Purple: (0xAF, 0x00, 0xFF),
           Blue  : (0x00, 0xD7, 0xFF)}

Screenshots:
Leds on.
Leds off.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.