Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjg30737/random-matrix-generator
Random small dot covered matrix generator
https://github.com/yjg30737/random-matrix-generator
py37 pyqt pyqt-examples pyqt-tutorial pyqt5 pyqt5-examples pyqt5-matrix pyqt5-tutorial python python3 python37 qgraphicsview qt
Last synced: 5 days ago
JSON representation
Random small dot covered matrix generator
- Host: GitHub
- URL: https://github.com/yjg30737/random-matrix-generator
- Owner: yjg30737
- License: mit
- Created: 2021-11-21T09:57:27.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-29T09:12:33.000Z (almost 3 years ago)
- Last Synced: 2023-03-04T22:18:04.953Z (over 1 year ago)
- Topics: py37, pyqt, pyqt-examples, pyqt-tutorial, pyqt5, pyqt5-examples, pyqt5-matrix, pyqt5-tutorial, python, python3, python37, qgraphicsview, qt
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# random-matrix-generator
Random small dot covered matrix generator## Requirements
PyQt5 >= 5.8## Setup
```
pip install git+https://github.com/yjg30737/random-matrix-generator.git --upgrade
```## Example
Code
```python
from PyQt5.QtWidgets import QWidget, QApplication, \
QHBoxLayout, QPushButtonfrom random_matrix_generator import RandomMatrixGraphicsView
class RmgExample(QWidget):
def __init__(self):
super().__init__()
self.__initUi()def __initUi(self):
self.setWindowTitle('rmg')
self.__rmg = RandomMatrixGraphicsView()
self.__rmg.setHDotCount(100) # set count of horizontal dots
self.__rmg.setVDotCount(75) # set count of vertical dots
self.__rmg.setDotSize(5) # set the size of each dots
self.__rmg.setBorder(True) # set the border which surrounds the matrix
genBtn = QPushButton('Generate')
genBtn.clicked.connect(self.generate)
lay = QHBoxLayout()
lay.addWidget(self.__rmg)
lay.addWidget(genBtn)self.setLayout(lay)
def generate(self):
self.__rmg.generate()if __name__ == "__main__":
import sysapp = QApplication(sys.argv)
rmgExample = RmgExample()
rmgExample.show()
app.exec()
```
Result![RandomMatrixGenerator](./example/rmgExample.png)
Looks like QR code to me. Not quite the same though, it shall bears a resemblence.
If you click generate button once more, matrix won't reset; It will be more covered by another random generated dots. I will make an option of that soon enough.