Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjg30737/pyqt-instant-search-bar
PyQt instant search bar
https://github.com/yjg30737/pyqt-instant-search-bar
instantsearch pyqt pyqt-examples pyqt-tutorial pyqt5 pyqt5-examples pyqt5-tutorial python python3 python37 qlabel qlineedit qt searchbar
Last synced: about 1 month ago
JSON representation
PyQt instant search bar
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-instant-search-bar
- Owner: yjg30737
- License: mit
- Created: 2022-02-25T04:22:30.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-21T02:55:12.000Z (11 months ago)
- Last Synced: 2024-12-20T14:23:18.205Z (about 2 months ago)
- Topics: instantsearch, pyqt, pyqt-examples, pyqt-tutorial, pyqt5, pyqt5-examples, pyqt5-tutorial, python, python3, python37, qlabel, qlineedit, qt, searchbar
- Language: Python
- Homepage:
- Size: 53.7 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyqt-instant-search-bar
![image](https://user-images.githubusercontent.com/55078043/155654257-4d31a17a-fc64-4292-aecc-cf46a9580f18.png)
PyQt(+PySide) instant search bar.
## Requirements
* PyQt5 >= 5.8## Setup
`python -m pip install pyqt-instant-search-bar`## Methods/Signal Overview
* #### `setLabel(visibility: bool = True, text=None)`
Set the visibility of search icon. You can set the text with this function too.
* #### `setSearchIcon(icon_filename: str)`
Set the icon. icon should be svg file.
* #### `setPlaceHolder(text: str)`
* #### `getSearchBar()`
* #### `getSearchLabel()`
* ## `searched(text: str)` signal to get the text which is written in the search bar. See the example below.#### Since 0.0.18
I want to talk about icon size.
Size maybe looks small than preview and in general as well.
So you can change the icon size like this:
```python
lbl = searchBar.getSearchLabel()
lbl.setFixedSize(lbl.size().width() * 2, lbl.size().height() * 2)
```## Preview
Code Sample```python
from PyQt5.QtWidgets import QApplication
from pyqt_instant_search_bar import InstantSearchBarif __name__ == "__main__":
import sysapp = QApplication(sys.argv)
searchBar = InstantSearchBar()
searchBar.searched.connect(print) # print the written text
searchBar.show()
app.exec_()
```Result
![image](https://user-images.githubusercontent.com/55078043/155654257-4d31a17a-fc64-4292-aecc-cf46a9580f18.png)
## See Also
* pyqt-search-bar-menu - QMenu which has search bar as a first item to help you search the menu items.
* pyqt-search-bar - This supports search button. (click to search, not instant search)
* pyqt-database-example - Search the sql database table(using QSqlTableModel) with instant search bar.