Hi

Please have a look at the following 2 pieces of code.

Qt Code:
  1. ExplainBrowser b;//QTextBrowser
  2. b.setText(str);
  3. //b.show();
  4. int eHeight = b.contentsHeight();//wrong height
  5. int eWidth = b.contentsWidth();//wrong width
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. ExplainBrowser b;//QTextBrowser
  2. b.setText(str);
  3. b.show();
  4. int eHeight = b.contentsHeight();//correct height
  5. int eWidth = b.contentsWidth();//correct width
To copy to clipboard, switch view to plain text mode 

Is there a way by which I can the correct contentsHeight() and contentsWidth() without actually showing the widget?

Thanks a lot.

By the way I am using Qt 3.3.6