Skip to main content

pyqt-find-text-widget

PyQt widget which can be used to find text in QTextEdit/QTextBrowser

Requirements

PyQt5 >= 5.8

Setup

python -m pip install pyqt-find-text-widget

Included Packages

Feature

  • Find previous, next occurence based on text cursor's position

    • prev shortcut: Ctrl+Shift+D

    • next shortcut: Ctrl+D

  • Match case

  • Makes find match only complete words

  • Providing prev, next, close signals

  • Enable to set close button with setCloseBtn(f: bool)

I'm still working with regex feature.

Signal

  • prevClicked

  • nextClicked

  • closeSignal

Usage

Code Sample

from PyQt5.QtWidgets import QMainWindow, QApplication, QGridLayout, QWidget, QTextEdit

from pyqt_find_text_widget.findTextWidget import FindTextWidget





class MainWindow(QMainWindow):

    def __init__(self):

        super().__init__()

        self.__initUi()



    def __initUi(self):

        self.__te = QTextEdit()

        self.__te.setStyleSheet('QTextEdit { selection-background-color: lightblue; }') # I wrote this code because color of default selection doesn't stand out in the white textedit screen.



        self.__w = FindTextWidget(self.__te)



        lay = QGridLayout()

        lay.addWidget(self.__w)

        lay.addWidget(self.__te)



        mainWidget = QWidget()

        mainWidget.setLayout(lay)



        self.setCentralWidget(mainWidget)





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    mainWindow = MainWindow()

    mainWindow.show()

    sys.exit(app.exec_())

Result

Note: Button icons in preview are obsolete. Back then these icons were PNG, now these are SVG! So don't worry about the difference.

https://user-images.githubusercontent.com/55078043/147844492-53b355ff-801a-4fca-bbef-c37fb55d1418.mp4

Match case & complete word only example

https://user-images.githubusercontent.com/55078043/147844473-76474b51-2b2d-4680-82e4-8a67ab263db3.mp4

Download files

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

Source Distribution

pyqt-find-text-widget-0.0.12.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyqt_find_text_widget-0.0.12-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file pyqt-find-text-widget-0.0.12.tar.gz.

File metadata

  • Download URL: pyqt-find-text-widget-0.0.12.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 CPython/3.7.6

File hashes

Hashes for pyqt-find-text-widget-0.0.12.tar.gz
Algorithm Hash digest
SHA256 251e67508fa335a569155c400e666af09043c0431d98de9cedb0815ecbfca28d
MD5 04873ed25a76f5c936fee2f1dedb688c
BLAKE2b-256 880ad285e210531e894f49e65fe327948ba3b8338c30a5abb06fbb30c61a4d09

See more details on using hashes here.

File details

Details for the file pyqt_find_text_widget-0.0.12-py3-none-any.whl.

File metadata

File hashes

Hashes for pyqt_find_text_widget-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 51ef77766a41523402c3b60aec43a10829819d37d4f59fe1094f2b6276fc79b0
MD5 df6febdee0c7a864e1a2fc623d706586
BLAKE2b-256 6efcfe440a484e47a70742e94ca5835cb6a2ccaa6997b9e25560d51d4c9a76ba

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.12 This release

2 files

0.0.11

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page