Blocking Issue WebView: in QML does not handle dropdown lists



  • Hi all,
    I am experiencing a lot of troubles with the qt 5.2.1. One of the here is that WebView does not seem to handle
    dropdown in pages. When you click on a dropdown nothing happens - leaving the entire WebView useless
    !

    Example:
    @import QtQuick 2.1
    import QtWebKit 3.0

    Rectangle {
    width:1280
    height:1024

    WebView {
        id:browser
        anchors.fill: parent
        url:"http://personal-computer-tutor.com/dropdown.htm"
    
    }
    

    }@



  • You need to implement a default item selector in QtQuick, and then tell QtWebKit about that type as the item selector for the webview via the experimental API (QQuickWebViewExperimental and friends).

    See qtwebkit/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h

    Cheers,
    Chris.



  • Hmm - can somebody tell me why the view is not self contained at handling these events for dropdowns ? Shouldn't it handle the action ?
    Am I missing something something here and failed to understand why is this behavior designed like this ?

    As I see it - it comes directly from Webkit and WebView does not implement the action handling ?

    Adrian



  • Because there is no one-size-fits-all solution for list item selectors. The nature of the problem requires different solutions on different platforms.

    So, you have two choices: try to include a "good item selector" for every single possible imaginable platform, inside the qtwebkit code (which is clearly impossible) OR allow the client to specify an item selector which is used by qtwebkit whenever required.

    Cheers,
    Chris.



  • Ok - thanks. I will look into it.

    Adrian



  • @chrisadams I looked around a lot and cannot find much that mentions using the experiemental stuff. The only example of an item selector I can find anywhere is -https://github.com/adobe/webkit/blob/master/Tools/MiniBrowser/qt/qml/ItemSelector.qml

    Is the above what you are referring to? If that is, the only way I can see to set the selector is from c++ http://stackoverflow.com/questions/21133817/access-qml-webview-from-c

    All the stuff I did find though referenced WebView 2, but I believe (and I could be wrong) that WebView 3 is being used now (because of import WebKit 3.0)??

    Here are two reasons why I think (again could be wrong) that it is supposed to work without making an item selector:

    1. There is a bug filed on it that doesn't say to just use an itemselector - https://bugreports.qt-project.org/browse/QTBUG-39078
    2. Item selection works as expected when using one of the c++ based QWebView examples, such as "Fancy Browser"

    @asergiu did you find anything else about this? If you got something working I would be very interested in seeing how.



  • @jp36 - we abandoned the QML based browser in the favor of the view from C++ which handles all these without any problem. There was no reason for me to complicate things with item selectors just to be able to show a webpage.

    I tried to understand very, very quickly the reasons behind manual item selectors, and would they be needed instead of just performing the action like in QWebView - and for me there was no reason to force a stay on this page show in QML.



  • @asergiu On some mobile platforms, a dropdown is rendered as a full screen menu. Compare that to the dropdown seen on a desktop browser.



  • @jeremy_k - I understood after my first post and its reply (chrisadams) that this is not desirable for QML. Yet for me there was no reason to go this path of implementing selectors just for the love of QML.



  • @asergiu thanks for the response I was leaving towards doing that as well.

    @jeremy_k I understand the needing the ability to have a custom item selector if desired but if the c++ can handle it by default, why can't the QML one? It seems more of a bug/omission to me to not have an overidable default.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.