floogads
floogads

Reputation: 271

Tooltips not showing up on Ubuntu using PyQt4

I'm getting started with PyQt4 and tested the following code...

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()
sys.exit(app.exec_())

However, no tooltip shows up! I'm on Ubuntu 10.04. I also tried an icon and that didn't work either.

Upvotes: 0

Views: 2023

Answers (1)

Anthon
Anthon

Reputation: 76599

If the window you start your application from ( e.g. your terminal ) is active, hovering over your application will not show a Tooltip. As Ivo indicated you need to make the window of your application active for the Tooltips to show up.

Upvotes: 2

Related Questions