Results 1 to 3 of 3

Thread: scroll multiple QTextBrowser

  1. #1
    Join Date
    Jan 2012
    Posts
    29
    Thanks
    7

    Default scroll multiple QTextBrowser

    Hi all, in the same mainwindow I have two QTextBrowser which present a vertical scrollbar when needed. I would need to have a kind of merged view: when I scroll down text in the first QTextBrowser also the second one scroll down automatically and vice versa. I thought there was a signal to use but I could not figure it out. Any help?

    TIA,
    Jan

  2. #2
    Join Date
    Mar 2011
    Location
    Denmark
    Posts
    74
    Thanks
    7
    Thanked 10 Times in 9 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: scroll multiple QTextBrowser

    There is a signal.

    QScrollbar has a sliderMoved signal and a setValue slot

    Qt Code:
    1. QObject::connect(browserOne->verticalScrollBar(), SIGNAL(sliderMoved(int)), browserTwo->verticalScrollBar(), SLOT(setValue(int)));
    To copy to clipboard, switch view to plain text mode 

    and vice versa

  3. The following user says thank you to Berryblue031 for this useful post:

    dotjan (25th April 2012)

  4. #3
    Join Date
    Jan 2012
    Posts
    29
    Thanks
    7

    Default Re: scroll multiple QTextBrowser

    Thanks a lot, it works. I found even better to use the signal valueChanged(int) so that also when the scrollbar is clicked it is emitted.

Similar Threads

  1. Scroll bars in scroll area not comming in scroll area
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 4th January 2012, 06:50
  2. Scroll bars in scroll area not comming
    By aurora in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2011, 19:56
  3. QDial disabling key scroll and mouse wheel scroll
    By ldg20 in forum Qt Programming
    Replies: 2
    Last Post: 2nd June 2010, 23:05
  4. QTextBrowser, how to scroll ?
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 22nd December 2006, 07:57
  5. Replies: 6
    Last Post: 14th April 2006, 05:39

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
  •  
Qt is a trademark of The Qt Company.