-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
5.4.0
-
None
-
windows
This bug have been in QTBUG-15009 earlier. Reproduced again in 5.4.0. I have tested bug in Python too:
code:
import sys if 'qt4' in sys.argv: sys.argv.remove('qt4') from PyQt4.QtCore import * from PyQt4.QtGui import * else: from PyQt5.QtCore import * from PyQt5.QtWidgets import * class WidgetGallery(QDialog): def __init__(self, parent=None): super(WidgetGallery, self).__init__(parent) b = QPushButton('html') b.setToolTip("<nobr>Words: <b>only one-God</b></nobr>"); c = QComboBox() c.addItem('html') c.setToolTip("<nobr>Words: <b>only one-God</b></nobr>"); cb = QComboBox() cb.addItem('text') cb.setToolTip("simple text"); lay = QHBoxLayout() lay.addWidget(b) lay.addWidget(c) lay.addWidget(cb) self.setLayout(lay) if __name__ == '__main__': app = QApplication(sys.argv) app.setStyleSheet(r'''QToolTip { font-size: 12pt; color: #FFFF00; border: 1px solid #FF0000; background-color: #000000; }''') gallery = WidgetGallery() gallery.setWindowTitle('Qt '+qVersion()) gallery.show() sys.exit(app.exec_())
Additional behavior:
While first tooltip not closed and if popup new tooltip, then frame of new tooltip will be right.
After all
While debugging Qt sources i found something interesting:
At calculating function QLabelPrivate::sizeForWidth fields leftmargin rightmargin of QFramePrivate is used. But that fields initialized later than QTipLabel init. Function QFramePrivate::updateStyledFrameWidths initialize fields of frame after QTipLabel have been rendered.
When new tooltip requested QTipLabel use reuseTip with right QFramePrivate parameters.
And finally tooltip driven by another widget like QPushButton haven't that bug.
- duplicates
-
QTBUG-15009 QComboBox tooltip with style sheet doesn't render correctly
-
- Open
-