Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yjg30737/pyqt-tooltip-list-widget
PyQt QListWidget which shows text as tooltip longer than widget's size
https://github.com/yjg30737/pyqt-tooltip-list-widget
pyqt pyqt-examples pyqt-tutorial pyqt5 pyqt5-examples qlistview qlistwidget qt qt-examples qt-tutorial qt5 qt5-examples qt5-tutorial qtooltip
Last synced: about 1 month ago
JSON representation
PyQt QListWidget which shows text as tooltip longer than widget's size
- Host: GitHub
- URL: https://github.com/yjg30737/pyqt-tooltip-list-widget
- Owner: yjg30737
- License: mit
- Created: 2022-03-20T05:28:12.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-14T09:22:23.000Z (over 2 years ago)
- Last Synced: 2024-12-25T14:03:28.652Z (about 2 months ago)
- Topics: pyqt, pyqt-examples, pyqt-tutorial, pyqt5, pyqt5-examples, qlistview, qlistwidget, qt, qt-examples, qt-tutorial, qt5, qt5-examples, qt5-tutorial, qtooltip
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyqt-tooltip-list-widget
PyQt QListWidget which shows text as tooltip longer than widget\'s size## Requirements
* PyQt5 >= 5.8## Setup
`python -m pip install pyqt-tooltip-list-widget`## Example
Code Sample```python
from PyQt5.QtWidgets import QWidget, QGridLayout, QApplication
from pyqt_tooltip_list_widget import ToolTipListWidgetclass Widget(QWidget):
def __init__(self):
super().__init__()
self.__initUi()def __initUi(self):
self.__listWidget = ToolTipListWidget()
self.__listWidget.addItem(
'Note: The selection rectangle will only be visible if the selection mode is in a mode where more than one item can be selected; i.e., it will not draw a selection rectangle if the selection mode is QAbstractItemView::SingleSelection.')
self.__listWidget.addItem('B')
self.__listWidget.addItem('C')lay = QGridLayout()
lay.addWidget(self.__listWidget)
lay.setContentsMargins(0, 0, 0, 0)
self.setLayout(lay)if __name__ == "__main__":
import sysapp = QApplication(sys.argv)
example = Widget()
example.show()
app.exec_()
```Result
![image](https://user-images.githubusercontent.com/55078043/159149622-70896610-30c3-431d-859d-4f87b96267fe.png)