Skip to main content

PyQt search bar

Project description

pyqt-search-bar

PyQt search bar

Requirements

PyQt5 >= 5.8

Setup

python -m pip install pyqt-search-bar

Included Packages

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

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_()

Result

Empty search bar (search button is disabled)

image

Search bar which is not empty (search button is enabled)

image

See Also

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyqt-search-bar-0.0.14.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

pyqt_search_bar-0.0.14-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page