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();//wrong height
int eWidth = b.contentsWidth();//wrong width
To copy to clipboard, switch view to plain text mode
ExplainBrowser b;//QTextBrowser
b.setText(str);
b.show();
int eHeight = b.contentsHeight();//correct height
int eWidth = b.contentsWidth();//correct width
ExplainBrowser b;//QTextBrowser
b.setText(str);
b.show();
int eHeight = b.contentsHeight();//correct height
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
Bookmarks