Results 1 to 2 of 2

Thread: QScrollBar's background and or its margin render problem!

  1. #1
    Join Date
    Jul 2010
    Posts
    41
    Thanks
    6
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QScrollBar's background and or its margin render problem!

    Please see the attached photo! (OS: Ubuntu-11.04 with Radiance Theme)
    How can I update that part of QScrollBar when scrolling? I mean some codes like followng code that I use for QTableWidget::viewport().

    Qt Code:
    1. //updating table's viewport
    2. connect(table->verticalScrollBar(), SIGNAL(valueChanged(int)), table->viewport(), SLOT(update()));
    3. connect(table->horizontalScrollBar(), SIGNAL(valueChanged(int)), table->viewport(), SLOT(update()));
    To copy to clipboard, switch view to plain text mode 
    and it works good.
    There is a way for set that margin to zero pixel?(The QtCreator's scrollbars have zero margins!)
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QScrollBar's background and or its margin render problem!

    How can I update that part of QScrollBar when scrolling?
    Just like the docs say:
    Use viewport->update() to update the contents of the viewport instead of update() as all painting operations take place on the viewport.
    Which is just the same as the code example you posted.
    Doesn't it work?
    There is a way for set that margin to zero pixel?
    Did you try setViewportMargins()?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Replies: 2
    Last Post: 16th June 2011, 10:56
  2. Replies: 1
    Last Post: 13th April 2011, 23:11
  3. Replies: 0
    Last Post: 11th December 2010, 00:01
  4. Styling background of QScrollBar
    By martinn in forum Qt Programming
    Replies: 1
    Last Post: 19th February 2010, 11:06
  5. qss + QScrollBar background issue
    By Lykurg in forum Qt Programming
    Replies: 0
    Last Post: 25th July 2007, 16:17

Tags for this Thread

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.