Document hint lastChild() hack
This commit is contained in:
parent
4661f2c30b
commit
387d0e3be6
3
THANKS
3
THANKS
@ -25,9 +25,10 @@ valuable ones:
|
||||
- chelmuth
|
||||
- quark
|
||||
- Bleeding Fingers
|
||||
- artyom.stv
|
||||
|
||||
Thanks to these people for helpful bits and pieces in the Qt bugtracker and IRC
|
||||
channel:
|
||||
channels:
|
||||
- Allan Sandfeld Jensen
|
||||
- bachewii
|
||||
- Vitaliy Filippov
|
||||
|
@ -266,6 +266,11 @@ class HintManager(QObject):
|
||||
css = self.HINT_CSS.format(left=rect.x(), top=rect.y(),
|
||||
config=config.instance)
|
||||
doc = self._frame.documentElement()
|
||||
# It seems impossible to create an empty QWebElement for which isNull()
|
||||
# is false so we can work with it.
|
||||
# As a workaround, we use appendInside() with markup as argument, and
|
||||
# then use lastChild() to get a reference to it.
|
||||
# See: http://stackoverflow.com/q/7364852/2085149
|
||||
doc.appendInside('<span class="qutehint" style="{}">{}</span>'.format(
|
||||
css, string))
|
||||
return doc.lastChild()
|
||||
|
Loading…
Reference in New Issue
Block a user