I was wondering what would be the best way to change the background color of
the selected text highlight in QWebView when the window is inactive?
Let me elaborate...
I'm using a (sub-classed) QWebView as a WYSIWYG editor component, and I've
now mostly implemented a find&replace dialog. Now the dialog is a separate,
non-modal window that can control the QWebView. I have managed to
QWebView is in a separate window which is inactive, the text is highlighted
in a very light gray color. It's barely distinguishable from the white
Now if I switch the focus back to the main window, the highlight is that
nice blue color again. But I don't want the main window to have focus. I
want the find&replace dialog to keep it so the user can continue pressing
<Enter> with the "Find Next" button selected.
So I'm wondering how I could change that inactive selected text background
color. I've already tried using a custom QPalette, but QWebView ignores
this. I've read this can happen.
I was thinking of getting the size of the dimensions of the highlighted
rectangle and painting over that, but I don't know how to get those
dimensions. It also seems like overkill, but I'd be willing to try it.
I know I could do this by temporarily changing the underlying HTML and
inserting some highlighting CSS + <span>, but that's the last thing I'm
willing to try. I _really_ don't want to mess with the user's code.
Does anyone have any ideas?
Thanks in advance,
Qt-interest mailing list