R
R
Rishat Sultanov2016-08-25 17:50:21
Python
Rishat Sultanov, 2016-08-25 17:50:21

The problem is with the QWidget class. How to set up PyQ4t to work properly?

Generally does not display the widget's context tooltip based on the QWidget class.

#!/usr/bin/python

# tooltip.py

import sys
from PyQt4 import QtGui
from PyQt4 import QtCore


class Tooltip(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        self.setGeometry(300, 300, 250, 150)
        self.setWindowTitle('Tooltip')

        self.setToolTip('This is a <b>QWidget</b> widget')
        QtGui.QToolTip.setFont(QtGui.QFont('OldEnglish', 10))


app = QtGui.QApplication(sys.argv)
tooltip = Tooltip()
tooltip.show()
app.exec_()

D1c2E535.jpg
What could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-08-26
@Avernial

Judging by your screenshot, your Widget is not active, so the tooltip is not shown. Click inside the `Tooltip` window, and then wait, and a hint should appear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question