Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjg30737/pyqt-search-bar
PyQt search bar
https://github.com/yjg30737/pyqt-search-bar
pyqt pyqt-examples pyqt-search-bar pyqt-searchbar pyqt-tutorial pyqt5 pyqt5-examples pyqt5-gui pyqt5-search-bar pyqt5-searchbar pyqt5-tutorial python python3 python37 qlineedit qt
Last synced: about 1 month ago
JSON representation
PyQt search bar
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-search-bar
- Owner: yjg30737
- License: mit
- Created: 2021-12-10T05:23:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-13T07:39:47.000Z (over 2 years ago)
- Last Synced: 2024-12-27T05:30:14.383Z (about 2 months ago)
- Topics: pyqt, pyqt-examples, pyqt-search-bar, pyqt-searchbar, pyqt-tutorial, pyqt5, pyqt5-examples, pyqt5-gui, pyqt5-search-bar, pyqt5-searchbar, pyqt5-tutorial, python, python3, python37, qlineedit, qt
- Language: Python
- Homepage:
- Size: 80.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyqt-search-bar
PyQt search bar## Requirements
PyQt5 >= 5.8## Setup
`python -m pip install pyqt-search-bar`## Included Packages
* pyqt-resource-helper
* pyqt-svg-button## Feature
* Providing `searched(text: str)` signal to activate user-defined method after search.
* Set place holder directly with `setPlaceHolder(text: str)`.
* Available to execute the search with either pressing enter or pressing the search button.
* Toggled search button based on whether searchLineEdit(type is QLineEdit) is empty or not.
* Being able to get searchLineEdit and searchButton, closeButton to let user customize on their own.
* Being able to set the label of the search bar with `setLabel(visibility: bool, text: str)`.
* Being able to close the search bar with `setCloseBtn(visibility: bool)`.
* Set search/close button's icon with `setSearchIcon(icon_filename: str)`, `setCloseIcon(icon_filename: str)`. Note: Icon should be SVG file.
* Get search bar, search line edit, search/close button with `getSearchBar`, `getSearchButton`, `getCloseButton` to change style or feature.## Example
### Basic
Code Example```python
from PyQt5.QtWidgets import QApplication
from pyqt_search_bar import SearchBarif __name__ == "__main__":
import sysapp = QApplication(sys.argv)
searchBar = SearchBar()
searchBar.setPlaceHolder('Input the text...')
searchBar.show()
app.exec_()
```#### Result
Empty search bar (search button is disabled)
![image](https://user-images.githubusercontent.com/55078043/167742517-108289ad-4560-4636-bbcf-f311700c8e06.png)
Search bar which is not empty (search button is enabled)
![image](https://user-images.githubusercontent.com/55078043/167742674-9270435a-18f9-47fb-abf3-9144cb3d5035.png)
See Also
* pyqt-instant-search-bar - instant search bar gui