Results 1 to 3 of 3

Thread: how to scroll a textbrowser ?

  1. #1
    Join Date
    Jul 2012
    Posts
    9
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Post how to scroll a textbrowser ?

    Hi,

    I have tried to scroll my textbrowser .But i am not able to do .

    Qt Code:
    1. QString currmsg = "The Koran. \nfdfjk .\nncdfjklgjf.\njdfkhjdfk";
    2.  
    3.  
    4. QTextCursor *temp = new QTextCursor(ui->textBrowser->textCursor());
    5. temp->insertText(currmsg);
    6.  
    7. temp->insertBlock();
    8. delete temp;
    9.  
    10.  
    11. ui->textBrowser->setStyleSheet("color:black");
    To copy to clipboard, switch view to plain text mode 

    Thanx

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to scroll a textbrowser ?

    Qt Code:
    1. QTextCursor cursor = ui->textBrowser->textCursor();
    2. cursor.setPosition(0);
    3. ui->textBrowser->setTextCursor(cursor);
    To copy to clipboard, switch view to plain text mode 
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  3. #3
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to scroll a textbrowser ?

    hi,

    When the text size is more, the scroll bar will come automatically.

    hope it helps,
    bala

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. Replies: 0
    Last Post: 28th December 2009, 12:24
  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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.