Results 1 to 2 of 2

Thread: Qml plugin in html inside WebView problem

  1. #1
    Join Date
    Nov 2008
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Qml plugin in html inside WebView problem

    Hi everyone,
    I have strange problem. I want to use qml plugin inside html which is use by webview in qml form. I've found solution which says if i want to do so i have to follow this:

    Qt Code:
    1. import QtWebKit 2.1
    2. import Qt 4.7
    3.  
    4. WebView {
    5. width: 500; height: 500
    6. settings.pluginsEnabled: true
    7. html: "<html>\
    8. <body bg color=white>\
    9. These are QML plugins, shown in a QML WebView via HTML OBJECT tags\
    10. <table border=1>\
    11. <tr><th>Duration <th>Color <th>Plugin\
    12. <tr><td>500 <td>red <td><object data=ColorSquare.qml type=x-qt-plugin width=100 height=100 ></object>\
    13. <tr><td>2000 <td>blue <td><OBJECT data=ColorSquare.qml type=application/x-qt-plugin width=100 height=100 period=2000 color=blue />\
    14. <tr><td>1000 <td>green <td><OBJECT data=ColorSquare.qml type=application/x-qt-plugin width=100 height=100 period=1000 color=green />\
    15. </table>\
    16. </body>
    17. </html>"
    18. }
    To copy to clipboard, switch view to plain text mode 

    ColorSquare.qml


    Qt Code:
    1. import Qt 4.7
    2.  
    3. Item {
    4. property int period: 250 //unused for sake of space
    5. property string color: "black"
    6. id: root
    7. Item {
    8. x: root.width/2; y: root.height/2
    9. Rectangle {
    10. color: root.color
    11. width: root.width; height: width
    12. x: -width/2; y: -height/2
    13. }
    14. }
    15. }
    To copy to clipboard, switch view to plain text mode 
    Everything should work but problem is it's not. when you run this code instead of plugin webview display empty blocks with missing plugin icon.

    Do you know solution to this problem by any chance?
    Maybe there is no support for that kind of approach?
    Thank you in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qml plugin in html inside WebView problem

    Did you implement the actual plugin?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Embed Plugin Widget into WebView
    By hvitual in forum Qt Programming
    Replies: 4
    Last Post: 21st July 2013, 16:07
  2. Replies: 0
    Last Post: 16th April 2010, 11:16
  3. Replies: 1
    Last Post: 23rd January 2010, 13:16
  4. HTML and *clickable links* inside a QListView?
    By Garibaldi in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2008, 10:44
  5. [SOLVED] Q_ENUMS from another class inside a plugin
    By desch in forum Qt Programming
    Replies: 1
    Last Post: 1st December 2007, 15:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.