[Qt-interest] Qt4.4 QTextEdit size and viewport() size
Josh
jnfo-c at grauman.com
Sat Feb 7 02:48:10 CET 2009
Thanks for the pointer. It looked promising, but unfortunately,
MyTextEdit->document().size() doesn't return the actual size of the
'underlying widget'.
Josh
> Josh wrote:
>
>> Hello,
>>
>> This should be simple but I can't figure it out. I have a QTextEdit
>> with lots of text so that scrollbars appear. I'm trying to get the size
>> of the widget that contains the text (for lack of a better
>> description). I thought the viewport() function did this, but it only
>> returns the size of the visible portion of the QTextEdit. The size of
>> the QTextEdit itself likewise is only the size of the visible widget.
>>
>> So for example if you have a QTextEdit with many pages of text, the
>> height of the widget I'm looking for should certainly be more than the
>> number of pixels of the height of the screen, but both the QTextEdit's
>> height() function and the viewport() height() function both return the
>> number of pixels on the screen.
>>
>> Thoughts? Ultimately it would be nice not just to get the size of the
>> underlying widget, but also a pointer to it itself. Thanks.
>>
>> Josh
>
> Hi Josh,
>
> Try MyTextEdit->document().size()
>
>> From your description, I think the 'underlying widget' is virtual in the
> case QTextEdit.
>
> Tony.
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list