munna
24th April 2006, 18:33
Hi
Please have a look at the following 2 pieces of code.
ExplainBrowser b;//QTextBrowser
b.setText(str);
//b.show();
int eHeight = b.contentsHeight();//wrong height
int eWidth = b.contentsWidth();//wrong width
ExplainBrowser b;//QTextBrowser
b.setText(str);
b.show();
int eHeight = b.contentsHeight();//correct height
int eWidth = b.contentsWidth();//correct width
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
Please have a look at the following 2 pieces of code.
ExplainBrowser b;//QTextBrowser
b.setText(str);
//b.show();
int eHeight = b.contentsHeight();//wrong height
int eWidth = b.contentsWidth();//wrong width
ExplainBrowser b;//QTextBrowser
b.setText(str);
b.show();
int eHeight = b.contentsHeight();//correct height
int eWidth = b.contentsWidth();//correct width
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