Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjg30737/pyqt-left-right-text-completer
PyQt Left text, right text completer. Left text is major target of search.
https://github.com/yjg30737/pyqt-left-right-text-completer
pyqt pyqt-examples pyqt-gui pyqt-qcompleter pyqt-tutorial pyqt5 pyqt5-examples pyqt5-gui pyqt5-qcompleter pyqt5-tutorial python python3 python37 qcompleter qt
Last synced: about 2 months ago
JSON representation
PyQt Left text, right text completer. Left text is major target of search.
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-left-right-text-completer
- Owner: yjg30737
- License: mit
- Created: 2021-12-08T09:45:47.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-14T08:48:07.000Z (almost 3 years ago)
- Last Synced: 2024-12-27T05:30:13.066Z (about 2 months ago)
- Topics: pyqt, pyqt-examples, pyqt-gui, pyqt-qcompleter, pyqt-tutorial, pyqt5, pyqt5-examples, pyqt5-gui, pyqt5-qcompleter, pyqt5-tutorial, python, python3, python37, qcompleter, qt
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyqt-left-right-text-completer
PyQt Left text, right text completer. Left text is major target of search.## Detailed Description
QCompleter's popup widget is gridless QTableView. Right text is gray colored.
You can add a new pair of text to search with ```addText(text1, text2)```.
Text1 is left text, text2 is right text.
This completer is case insensitive as default.
## Requirements
PyQt5 >= 5.8## Setup
`python -m pip install pyqt-left-right-text-completer`## Example
Code Example
```python
from PyQt5.QtWidgets import QMainWindow, QLineEdit, QApplicationfrom pyqt_left_right_text_completer import LeftRightTextCompleter
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.__initUi()def __initUi(self):
searchBar = QLineEdit()
completer = LeftRightTextCompleter()
for i in range(1, 128):
completer.addText(chr(i), f'{i}') # chr(i) is left text, f'{i} is right text.
searchBar.setCompleter(completer)
self.setCentralWidget(searchBar)if __name__ == "__main__":
import sysapp = QApplication(sys.argv)
mainWindow = MainWindow()
mainWindow.show()
sys.exit(app.exec_())
```Result
![image](https://user-images.githubusercontent.com/55078043/145187262-498b2862-6af7-4f6c-b8ef-cea3f19974ec.png)