Important: Please read the Qt Code of Conduct -

QtWebKit - request a page as a mobile

  • Hi Guys,

    Can you guys solve a doubt about QtWebKit for me?

    I'm doing some tests in an embedded project that I'll develop now and I'm doing a list of buttons bigger than the screen to test the scroll property.
    So, I tryed this and used the Css "overflow-y: scroll;" and it works great but I only can scroll the page by touching the scroll and dragging it down and I do not want this.
    What I want is to use the css ":: webkit-scrollbar {display: none;}" and scroll the page just like we do on our mobile smartphone, scrolling in everywhere of the page.

    How I do this?

    Thanks and best regards.

  • I don't understand your question. What's wrong with using webkit-scrollbar { display: none; }? If you want to avoid scrolling in nested frames, use QWebSettings::FrameFlatteningEnabled

  • Yes, you really dont understand what I want to do.

    Lets get an practical example: Put a div element in your body, fix the height of this element and put allot of buttons. Then, put the css property div { overflow-y: scroll }.
    Is it scrolling now, right? The scrollbar appears in that div, right? Okay
    Now, active the object inspector and click in the mobile view, change the resolution of the device to 240x320 (this is the resolution of the device that I'm developing for) and add this css on the page: webkit-scrollbar { display: none; }.
    The div still scrolling down but the scrollbar is hidden, right? This is what I want to do on my project, but it isnt working.

    A thing that I have realised is that in my project the scroll is maked only if I click in the scrollbar and drops it down. What I want to do is different than that, I want to do just like we did in the above example, I want that the user scrolls the list just like in mobile, clicking on everywhere in the div and scrolling down the page.

    Did you understand me now?
    Thanks, best regards

  • What Qt events are you sending to the page? If wheel events are sent, it should be scrolling in the same way as when you are dragging scroll bar. If you device is using touch input, you probably need to recognize appropriate gesture and scroll page via API

Log in to reply