hit_test_result is a QWebHitTestResult. You can use the enclosingFrame().page() method to get a QWebPage and then use selectedText() on the QWebPage.
Alternately, in customize_ui() store a reference to the ui object in your plugin. The do self.ui_ref.document to get a reference to the QWebView.
|