ComboBox of HTML Select not working in QML WebView
-
wrote on 21 Sept 2014, 19:47 last edited by
Hello,
I have noticed that when I use the QML WebView the HTML Select ComboBox does not work at all.
I have found a Qt demo which does support the HTML Select ComboBox but it is not using QML.
What would be the quickest way of implementing this feature in terms of running inside QML?
Any tips would be appreciated.
Kind Regards,
Drew
-
wrote on 22 Sept 2014, 17:24 last edited by
You must assign a selector dialog to experimental.itemSelector in your QML WebView.
Basically, WebView does not implement selector control along with others (e.g. JS alert), it's left for users to implement them.See for example
https://github.com/adobe/webkit/blob/master/Tools/MiniBrowser/qt/qml/BrowserWindow.qml
uses
https://github.com/adobe/webkit/blob/master/Tools/MiniBrowser/qt/qml/ItemSelector.qml -
wrote on 22 Sept 2014, 18:06 last edited by
Thanks a lot for that. I didn't realise. I have added the line:
experimental.itemSelector: ItemSelector { }
But I am a bit stuck for implementing the ItemSelector { }
-
wrote on 22 Sept 2014, 18:08 last edited by
Does : ItemSelector automatically point to ItemSelector.qml ?
Am I missing anything?
-
wrote on 22 Sept 2014, 18:34 last edited by
Thanks !!! It is working!! Awesome!!
-
wrote on 22 Sept 2014, 18:44 last edited by
Looks like I spoke too soon.
That example works great for a few items, but I have 185 items, currencies, and this example does not work when there are 185 items.
I guess I will have to change ItemSelector.... :/
-
wrote on 23 Sept 2014, 07:52 last edited by
Drew, I am glad you figured how to use the selector!
However, example is example and you shall not just change the ItemSelector, but implement the selection widget that is most suitable for your device/screen. If you're on desktop, then I'd suggest going for QuickControls' Menu. -
wrote on 23 Sept 2014, 16:45 last edited by
Thanks Sergei,
I have now got an example to build upon.
I have no idea how to use the QuickControls to make the pop-up box.
I wonder if the new QtWebEngine will have the selector built-in?
Anyway I may have to subscribe to Qt technical support because I really have no idea how to use the QuickControls to make the pop-up.
But thanks for the help!
-
wrote on 24 Sept 2014, 08:36 last edited by
Drew,
I cannot tell you for the QtWebEngine. I doubt since this shall be platform-specific.
Quick Controls are nice and easy to work with, check their samples and you'll figure how to use Menu pop-up. -
wrote on 24 Sept 2014, 19:38 last edited by
Thank you so much Sergei.
I tried and succeeded in modifying the example to do what I want.
Now it is also ready for mobile devices so thanks again!
1/10