Skip to content

A Qt package that lets you use web URLs as tooltips in Qt widgets

License

Notifications You must be signed in to change notification settings

ColinKennedy/qwebtip

Repository files navigation

Overview

tests
Requirements Status
Codacy Badge
package

A Qt package that lets you use web URLs as tooltips in Qt widgets.

  • Free software: BSD 2-Clause License

https://user-images.githubusercontent.com/10103049/64070456-031b2180-cc15-11e9-91d5-4a5d06a10a2e.gif

Requires

PySide or PyQt4 with QtWebKit included.

Installation

pip install qwebtip

How To Use

Import qwebtip's main model, qweburltip and set it to override one of your widget's tooltips with some URL.

The next time you build your application and hover over that widget, a URL box is displayed with that URL, instead.

from qwebtip import qweburltip

url = 'http://pyqt.sourceforge.net/Docs/PyQt4/qwebframe.html'
qweburltip.override_tool_tip(QtWidgets.QLabel('Some label'), url)

How To Use - Customizing

Setting a custom tooltip size

from qwebtip import qweburltip

url = 'http://pyqt.sourceforge.net/Docs/PyQt4/qwebframe.html'
qweburltip.override_tool_tip(
   QtWidgets.QLabel('Some label'),
   url,
   width=100,
   height=400,
)

Opening the URL at a specific header section

url = 'http://pyqt.sourceforge.net/Docs/PyQt4/qwebframe.html'
qweburltip.override_tool_tip(
   self.line_edit,
   element_selector.UnknownHeaderSelector(
       url,
       'Method Documentation',
   ),
)

Disabling Caching

Loaded webpages are cached so that successive loads can be kept fast. To disable caching, set this environment variable.

export QWEBTIP_DISABLE_CACHING=1

This is useful for debugging but is not recommended.

About

A Qt package that lets you use web URLs as tooltips in Qt widgets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages