ComboBox of HTML Select not working in QML WebView
-
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
-
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 -
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 { }
-
Does : ItemSelector automatically point to ItemSelector.qml ?
Am I missing anything?
-
Thanks !!! It is working!! Awesome!!
-
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.... :/
-
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. -
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!
-
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. -
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!