B
B
Baizel2019-06-22 19:31:54
Python
Baizel, 2019-06-22 19:31:54

How to make a message appear above lineedit?

We need the showText function to show a message near the cell (like a tooltip, but with a different text). The first argument is the coordinates. On the line shown in the code, it outputs it above the cell, but well above it. Does anyone understand this?

QtWidgets.QToolTip.showText(window.mapToGlobal(self.ui.lineEdit.pos()), "Текст ", self.ui.lineEdit)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Shokhrov, 2019-06-23
@Baizel

And so?

QtWidgets.QToolTip.showText(self.ui.lineEdit.mapToGlobal(QPoint(), …)

Possibly …(QPoint(0, self.ui.lineEdit.height))…. The docs say that the coordinates are for the "point of interest" and that the text is shown "at a platform-specific
offset from the point of interest ".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question