Results 1 to 6 of 6

Thread: Styling ScrollBar of QWebView via Qt StyleSheets?

  1. #1
    Join Date
    Apr 2007
    Location
    United States
    Posts
    17
    Thanks
    2
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Styling ScrollBar of QWebView via Qt StyleSheets?

    I just replaced a QTextEdit that was used for displaying rudimentary html in my application with a QWebView. My problem is I am unable to style the scrollbar via the QScrollBar tag in my stylesheet. I know that i could technically use the css in the html document myself but thats not what i am looking for. Has anyone attempted to do the same thing?

    Note: at the moment I am styling all QScrollBar's at the mainwindow level. So everything has the same look and feel. Except for the QWebView of course.

  2. #2
    Join Date
    Mar 2006
    Location
    Argentina - CABA
    Posts
    66
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11

    Default Re: Styling ScrollBar of QWebView via Qt StyleSheets?

    I am having the same issue here, before i was using QTextBrowser and now the actual WebKit (QWebView) for displaying HTML files of a Documentation module i am working on.

    But, seems QWebView does not accept stylesheets...

    Cheers.
    Gustavo A. DÃ*az
    artistic.gdnet.com.ar

  3. #3
    Join Date
    Aug 2009
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Styling ScrollBar of QWebView via Qt StyleSheets?

    Im asking the same question that was asked a yr back, Iam not able to style the QScrollBar component of QWebView, by just adding
    QScrollBar:Vertical and QScrollBar::handle parameters.

    Is this is a feature not supported, is there anyway to paint the QScrollBar component of QWebView.

  4. #4
    Join Date
    Mar 2006
    Location
    Argentina - CABA
    Posts
    66
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Platforms
    Unix/X11

    Default Re: Styling ScrollBar of QWebView via Qt StyleSheets?

    Hi,

    Any tip about this Guys?

    Cheers.
    Gustavo A. DÃ*az
    artistic.gdnet.com.ar

  5. #5
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Styling ScrollBar of QWebView via Qt StyleSheets?

    For now you need to hack around it, you can easily change the width as documented here:
    http://developer.qt.nokia.com/faq/an...ar_of_qwebview

    Note sure if other things besides the width can be easily changed.

  6. #6
    Join Date
    Mar 2010
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: Styling ScrollBar of QWebView via Qt StyleSheets?

    Well, you CAN'T do this by Qt Style Sheets, the only way to customize QWebView scroll bars is to use CSS, since WebKit supports scrollbar customization.
    See http://www.webkit.org/blog/363/styling-scrollbars/ for examples. This way worked well for me.
    You even do not have to have separate image files, you can use base64 encoding in CSS, just like this:

    background-image:url(data:image/png;base64,<base64 encoded png image>);

    Of course, this works only for your custom web pages, for all others pages you can inject your CSS in theirs code.

  7. The following user says thank you to papius_vtualetius for this useful post:

    Cupidvogel (27th February 2016)

Similar Threads

  1. Replies: 5
    Last Post: 21st July 2010, 23:51

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.