Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Blocking Issue WebView: in QML does not handle dropdown lists
Forum Updated to NodeBB v4.3 + New Features

Blocking Issue WebView: in QML does not handle dropdown lists

Scheduled Pinned Locked Moved QML and Qt Quick
10 Posts 4 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    asergiu
    wrote on last edited by
    #1

    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"
    
    }
    

    }@

    1 Reply Last reply
    0
    • C Offline
      C Offline
      chrisadams
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        asergiu
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • C Offline
          C Offline
          chrisadams
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            asergiu
            wrote on last edited by
            #5

            Ok - thanks. I will look into it.

            Adrian

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jp36
              wrote on last edited by
              #6

              @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.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                asergiu
                wrote on last edited by
                #7

                @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.

                1 Reply Last reply
                0
                • jeremy_kJ Offline
                  jeremy_kJ Offline
                  jeremy_k
                  wrote on last edited by
                  #8

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

                  Asking a question about code? http://eel.is/iso-c++/testcase/

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    asergiu
                    wrote on last edited by
                    #9

                    @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.

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      jp36
                      wrote on last edited by
                      #10

                      @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.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved