On Friday, February 18, 2011, Kun Zhang wrote: > I'm writing a plasmoid in Python with a WebView. The WebView will reload > the page automatically by a QTimer. But I don't want it to reload itself > when I'm viewing or typing in the plasmoid, because it will be very > annoying. So I have to know whether the plasmoid has keyboard focus. > > I tried hasFocus() of both Applet and WebView, but they always return > False. I also tried to override focusInEvent(), but it's never triggered.
two things you could try: * calling setFlag(QGraphicsItem::ItemIsFocusable, true) on the applet or the webview .. this still may not work (haven't tried) as the webview itself likely has the focus * call webview->mainFrame()->hasFocus() to see when it has focus. -- Aaron J. Seigo humru othro a kohnu se GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43 KDE core developer sponsored by Qt Development Frameworks
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel