Skip to main content

pyqt-tooltip-widget

PyQt QWidget as a tooltip

Requirements

  • PyQt5 >= 5.8

Setup

python -m pip install pyqt-tooltip-widget

Detailed Description

This is QWidget which is activated like tooltip. When mouse cursor enters to the widget, ToolTipWidget pops up at the bottom left of the widget. Leave from the widget tooltip will be disappeared.

I made it work by catching QEnterEvent and QLeaveEvent of widget.

ToolTipWidget inherits QWidget, so you can decorate it just like QWidget.

Usage

Just make instance of it like self.toolTip = ToolTipWidget(yourWidget). yourWidget argument is the widget which you want to set tooltip of. Instance should be class variable.

Method Overview

  • setStillOpenWhenCursorLeaveFromToolTipWidget(f: bool) - Tooltip will be kept showing when cursor is inside the tooltip. (this is disabled by default)

  • isStillOpenWhenCursorLeaveFromToolTipWidget() -> bool

Example

Code Sample

from PyQt5.QtWidgets import QWidget, QMainWindow, QHBoxLayout, QPushButton, QApplication, QVBoxLayout

from pyqt_date_table_widget import DateTableWidget

from pyqt_tooltip_widget import ToolTipWidget





class MainWindow(QMainWindow):

    def __init__(self):

        super().__init__()

        self.__initUi()



    def __initUi(self):

        btn = QPushButton('Show Date Table Widget')

        lay = QHBoxLayout()

        lay.addWidget(btn)



        mainWidget = QWidget()

        mainWidget.setLayout(lay)



        ### Make tooltip start ###

        dateTableWidget = DateTableWidget() # https://github.com/yjg30737/pyqt-date-table-widget.git

        lay = QVBoxLayout()

        lay.addWidget(dateTableWidget)

        lay.setContentsMargins(0, 0, 0, 0)



        self.__tooltip = ToolTipWidget(btn)

        self.__tooltip.setFixedSize(200, 200)

        self.__tooltip.setLayout(lay)

        ### Make tooltip end ###



        self.setCentralWidget(mainWidget)





if __name__ == "__main__":

    import sys



    app = QApplication(sys.argv)

    example = MainWindow()

    example.show()

    app.exec_()

Result

image

Metadata

Release files for pyqt-tooltip-widget 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyqt-tooltip-widget 0.0.1
File Size Uploaded Provenance Actions
pyqt-tooltip-widget-0.0.1.tar.gz 3.4 kB Without provenance Details for pyqt-tooltip-widget-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyqt-tooltip-widget 0.0.1
File Interpreter ABI Platform Actions
pyqt_tooltip_widget-0.0.1-py3-none-any.whl Python 3 none any Details for pyqt_tooltip_widget-0.0.1-py3-none-any.whl

Total release size: 7.4 kB

Release files / pyqt-tooltip-widget-0.0.1.tar.gz

Download URL pyqt-tooltip-widget-0.0.1.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7f5dad1d14e41bc644b048026cd4b5e84df184c60ecb64d9da6828e655464765
BLAKE2b-256 checksum
How to use checksums
40101989f8482acddcd06c238f7794d4d0d131c5c9c6ea476c280aefd05b7a42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 CPython/3.7.6

Release files / pyqt_tooltip_widget-0.0.1-py3-none-any.whl

Download URL pyqt_tooltip_widget-0.0.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a554b8201f51dc9c3e2cc79785e3d961336db4cc21c5114f14d20fd19c473b4
BLAKE2b-256 checksum
How to use checksums
09cdc6f4df3c6d69042c969fdae6d3300faefee4dfb5490ff42ec80c6bbd6db0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/0.0.0 CPython/3.7.6

Security for pyqt-tooltip-widget 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page