0

as the question states, I wish to embed a tinymce editor in a PyQT webkit component.

As far as I understand, evaluateJavascript allows for js functions to be called.

However, when I try loading tinymce.min.js, the editor does not display anything at all. As suspected, when evaluating a javascript that 'loads' other javascript files, they don't actually get loaded.

At this point, I feel lost. I will try to manually load 'plugins' that will be specified in tinymce's init function and will update this.

Till that time, any help would be really appreciated.

igmnlt
  • 220
  • 2
  • 7

1 Answers1

0

EvaluateJavaScript does make javascript function calls, or embed a whole javascript file. The following details out the attempts to solve the problem:

  • The approach of first reading the tinyMCE.js file and then using that in an evaluatejavascript method embeds the javascript somewhere, and can't be sniffed out in a webkit console. When loading files using the evaluatejavascript method, any dependencies, such as the ones that tinymce require, are not loaded. I think it's because javascript calls are "attached" to the webkit but not embedded in the frame's DOM itself.

  • The second approach consists of creating a webkit page and loading an html file. The html file itself embeds the javascript, so the component works like a "browser". In tinymce's configuration, toolbars and unnecessary parts were hidden. TinyMCE version 3 worked well with PyQt4. When the 4th version was embedded in an html page however, textareas were not being converted to tinymce editors. The console itself shows 'undefined' error messages, deduced to the assumption that tinymce 4 uses different javascript syntax and a different compiler.

And so ends my quest to write a stand-alone webkit editor. :)

igmnlt
  • 220
  • 2
  • 7
  • since this is doable in c++, it should be working in pyqt as well, right ? https://meetingcpp.com/index.php/br/items/integrating-an-html-editor-into-qt-using-javascript-and-qwebview.html – Shuman Apr 19 '16 at 17:41