PyQt search bar
PyQt5 >= 5.8
python -m pip install pyqt-search-bar
searched(text: str)
signal to activate user-defined method after search.setPlaceHolder(text: str)
.setLabel(visibility: bool, text: str)
.setCloseBtn(visibility: bool)
.setSearchIcon(icon_filename: str)
, setCloseIcon(icon_filename: str)
. Note: Icon should be SVG file.getSearchBar
, getSearchButton
, getCloseButton
to change style or feature.Code Example
from PyQt5.QtWidgets import QApplication
from pyqt_search_bar import SearchBar
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
searchBar = SearchBar()
searchBar.setPlaceHolder('Input the text...')
searchBar.show()
app.exec_()
Empty search bar (search button is disabled)
Search bar which is not empty (search button is enabled)
See Also