# KDTextDocument Class Reference

`#include <KDTextDocument.h>`

Inheritance diagram for KDTextDocument:

[legend]
Collaboration diagram for KDTextDocument:
[legend]
List of all members.

## Public Member Functions

| KDTextDocument (const QString &text, QObject *parent=0)
| KDTextDocument (QObject *parent=0)
QSize | minimumSizeHint ()
QSize | sizeHint ()
| ~KDTextDocument ()

## Constructor & Destructor Documentation

KDTextDocument::KDTextDocument | ( | QObject * | parent = 0 | ) | `[explicit]`

Definition at line 38 of file KDTextDocument.cpp.

    00039     : QTextDocument( p ),
    00040       mHintValid( false ),
    00041       mSizeHint(),
    00042       mMinimumSizeHint()
    00043 {
    00044
    00045 }

KDTextDocument::KDTextDocument | ( | const QString & | text,
|  | QObject * | parent = 0
| ) | `[explicit]`

Definition at line 47 of file KDTextDocument.cpp.

    00048     : QTextDocument( text, p ),
    00049       mHintValid( false ),
    00050       mSizeHint(),
    00051       mMinimumSizeHint()
    00052 {
    00053
    00054 }

KDTextDocument::~KDTextDocument | ( |  | ) |

Definition at line 56 of file KDTextDocument.cpp.

    00056 {}

## Member Function Documentation

QSize KDTextDocument::minimumSizeHint | ( |  | ) |

Definition at line 66 of file KDTextDocument.cpp.

Referenced by sizeHint().

    00067 {
    00068     /*
    00069     QTextCursor cursor( this );
    00070     if( ! cursor.atEnd() )
    00071         cursor.movePosition( QTextCursor::NextBlock );
    00072     qDebug() << "KDTextDocument::minimumSizeHint() found:" << cursor.block().text();
    00073     QSizeF s( documentLayout()->blockBoundingRect( cursor.block() ).size() );
    00074     qDebug() << "KDTextDocument::minimumSizeHint() found rect" << documentLayout()->blockBoundingRect( cursor.block());
    00075     return QSize( static_cast<int>(s.width()),
    00076                   static_cast<int>(s.height()) );
    00077     */
    00078
    00079     if( mHintValid )
    00080         return mMinimumSizeHint;
    00081
    00082     mHintValid = true;
    00083     mSizeHint = sizeForWidth( -1 );
    00084     QSize sz(-1, -1);
    00085
    00086     // PENDING(kalle) Cache
    00087     sz.rwidth() = sizeForWidth( 0 ).width();
    00088     sz.rheight() = sizeForWidth( 32000 ).height();
    00089     if( mSizeHint.height() < sz.height())
    00090         sz.rheight() = mSizeHint.height();
    00091
    00092     mMinimumSizeHint = sz;
    00093     return sz;
    00094 }

QSize KDTextDocument::sizeHint | ( |  | ) |

Definition at line 59 of file KDTextDocument.cpp.

References minimumSizeHint().

    00060 {
    00061     if( !mHintValid )
    00062         (void)minimumSizeHint();
    00063     return mSizeHint;
    00064 }

The documentation for this class was generated from the following files:

- KDTextDocument.h
- KDTextDocument.cpp