Skip to main content

PyQt QMenu which contains search bar as first item

Project description

pyqt-search-bar-menu

PyQt QMenu which contains auto search bar as first item

Requirements

  • PyQt5 >= 5.8

Setup

python -m pip install pyqt-search-bar-menu

Included Packages

Feature

  • Search bar is at the very top of the menu, let user search QAction's text. At this time menu list works like a completer.

Examples

Simple Code Sample

searchBarMenu = SearchBarMenu('Menu', self)

searchBarMenu.addAction('Action')

Executable Code Sample

from PyQt5.QtWidgets import QMainWindow, QApplication

from pyqt_search_bar_menu import SearchBarMenu





class MainWindow(QMainWindow):

    def __init__(self):

        super().__init__()

        self.__initUi()



    def __initUi(self):

        menubar = self.menuBar()

        filemenu = menubar.addMenu('File')



        searchBarMenu = SearchBarMenu('A Bunch of Actions', self)



        for i in range(5):

            action = searchBarMenu.addAction(f'Action{i+1}')



        filemenu.addMenu(searchBarMenu)



        menubar.addMenu(filemenu)

        self.setMenuBar(menubar)





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    ex = MainWindow()

    ex.show()

    app.exec_()

Result

image

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-menu-0.0.11.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

pyqt_search_bar_menu-0.0.11-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file pyqt-search-bar-menu-0.0.11.tar.gz.

File metadata

  • Download URL: pyqt-search-bar-menu-0.0.11.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 CPython/3.7.6

File hashes

Hashes for pyqt-search-bar-menu-0.0.11.tar.gz
Algorithm Hash digest
SHA256 cf3d685bdfa4b03d77702d9622e83566916ed1722bf0a74d6c7d5d8648135eda
MD5 e7895923cbbe4bdd71ce20970d80a90b
BLAKE2b-256 3f5174485a9bbf2d7ba3719629fb39054922d3d32f17b89be69ea60e08c3695d

See more details on using hashes here.

File details

Details for the file pyqt_search_bar_menu-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for pyqt_search_bar_menu-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 3553fbf5c7bacec3889fa1c65d3d657895f508b1d386c40f3b60e3fb6c88a91e
MD5 d4139d3de1c29b785772f3c40d6208fd
BLAKE2b-256 e8c157aecc0f3ffa3d09c66eb85491e928de95e45a2970cd441df221e210581e

See more details on using hashes here.

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