Python Forum
[SOLVED]PyQt5 tutorial
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED]PyQt5 tutorial
#1
I am trying to see if I want to use PyQt5 and am working my way through some tutorials. I haven't got very far yet.
This one does not show the tooltip when I hover over the button. All I did was copy and paste from
https://zetcode.com/gui/pyqt5/firstprograms/
#!/usr/bin/python

"""
ZetCode PyQt5 tutorial

This example
e shows a tooltip on
a window and a button.

Author: Jan Bodnar
Website: zetcode.com
"""

import sys
from PyQt5.QtWidgets import (QWidget, QToolTip,
    QPushButton, QApplication)
from PyQt5.QtGui import QFont


class Example(QWidget):

    def __init__(self):
        super().__init__()

        self.initUI()


    def initUI(self):

        QToolTip.setFont(QFont('SansSerif', 10))

        self.setToolTip('This is a <b>QWidget</b> widget')

        btn = QPushButton('Button', self)
        btn.setToolTip('This is a <b>QPushButton</b> widget')
        btn.resize(btn.sizeHint())
        btn.move(50, 50)

        self.setGeometry(300, 300, 300, 200)
        self.setWindowTitle('Tooltips')
        self.show()


def main():

    app = QApplication(sys.argv)
    ex = Example()
    sys.exit(app.exec_())


if __name__ == '__main__':
    main()
QT version is 5.12.8
PYQT version is 5.14.1
Running Linux Mint 20.3 Cinnamon
Python 3.8.10
Reply


Messages In This Thread
[SOLVED]PyQt5 tutorial - by Barrowman - Sep-12-2022, 04:06 PM
RE: PyQt5 tutorial - by deanhystad - Sep-12-2022, 06:48 PM
RE: PyQt5 tutorial - by Barrowman - Sep-13-2022, 03:24 PM
RE: PyQt5 tutorial - by Axel_Erfurt - Sep-13-2022, 05:04 PM
RE: PyQt5 tutorial - by deanhystad - Sep-13-2022, 05:35 PM
RE: PyQt5 tutorial - by Barrowman - Sep-13-2022, 07:40 PM
RE: PyQt5 tutorial - by Barrowman - Sep-15-2022, 08:26 AM
RE: PyQt5 tutorial - by Barrowman - Sep-15-2022, 09:31 AM
RE: PyQt5 tutorial - by Axel_Erfurt - Sep-15-2022, 11:31 AM
RE: PyQt5 tutorial - by Barrowman - Sep-16-2022, 12:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Huge code problems (buttons(PyQt5),PyQt5 Threads, Windows etc) ZenWoR 0 2,911 Apr-06-2019, 11:15 PM
Last Post: ZenWoR

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020