Results 1 to 3 of 3

Thread: how to adjust sizes of QTextBrowser?

  1. #1
    Join Date
    Jan 2006
    Location
    Poland/Poznań
    Posts
    14
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default how to adjust sizes of QTextBrowser?

    I'd like to make a QTextBrowser (as a separated window - not child), but it must display all it's contents without scrolling.
    example code:
    Qt Code:
    1. QTextBrowser *bro = new QTextBrowser(0);
    2. bro->setText("<img src=\"image.jpg\" border=\"0\" /> and sample text");
    3. bro->show();
    To copy to clipboard, switch view to plain text mode 
    As a result, QTextBrowser has always the same sizes, which doesn't fit it's contents.
    What can I do to fit QTextBrowser exactly to it's contents?

    bro->setFixedSize(bro->sizeHint());
    doesn't work

  2. #2
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to adjust sizes of QTextBrowser?

    Why don't you try with a QLabel instead?

  3. #3
    Join Date
    Jan 2006
    Location
    Poland/Poznań
    Posts
    14
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: how to adjust sizes of QTextBrowser?

    Quote Originally Posted by Chicken Blood Machine
    Why don't you try with a QLabel instead?
    I'd like to have links (and could open them with browsers) there.

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.