
Originally Posted by
Garfeild
I have new problem. I need to set cell height. I have tried to use QTextFrameFormat::setHeight(qreal height) but cells haven't resized. Also i tried to set height for whole table.
is not possibel!
only if you subclass QAbstractTextDocumentLayout and on a protected function
void QAbstractTextDocumentLayout::drawInlineObject ( QPainter * painter, const QRectF & rect, QTextInlineObject object, int posInDocument, const QTextFormat & format ) [virtual protected]
Called to draw the inline object object on the given painter within the rectangle specified by rect using the text format specified by format. posInDocument specifies the position of the object within the document.
you can insert all your elements ... structure and draw method...
only Cell_Width is possibel to set ... if you work on layer based
table are not needet have a look on http://code.google.com/p/fop-miniscribus/
and his xhtml export .... !not IE
{
qreal notfound = 0;
QVector<QTextLength> constraints = TableFormat.columnWidthConstraints();
for (int i = 0; i < constraints.size(); ++i) {
if (i == position) {
return langecell.rawValue();
}
}
}
return notfound;
}
qreal QVimedit::Get_Cell_Width( QTextTableFormat TableFormat , int position )
{
qreal notfound = 0;
QVector<QTextLength> constraints = TableFormat.columnWidthConstraints();
for (int i = 0; i < constraints.size(); ++i) {
if (i == position) {
QTextLength langecell = constraints.value(i);
if (langecell.type() == QTextLength::FixedLength) {
return langecell.rawValue();
}
}
}
return notfound;
}
To copy to clipboard, switch view to plain text mode
to insert other parameter to QTextBlock, QTextTableFormat , QTextImageFormat ... you can use QTextFormat::propertyi use this to save image data .... and i can save doc and image on not GUI QThread whitout use QPixmap.
.............
Pics = block.toImageFormat();
if (Pics.isValid()) {
const QString hrefadress
= Pics.
name();
QVariant inline_img_info
= Pics.
property(100);
if (!inline_img_info.isNull()) {
SPics pic = inline_img_info.value<SPics>();
}
}
QTextBlock::iterator de;
.............
Pics = block.toImageFormat();
if (Pics.isValid()) {
const QString hrefadress = Pics.name();
QString titles;
QVariant inline_img_info = Pics.property(100);
if (!inline_img_info.isNull()) {
SPics pic = inline_img_info.value<SPics>();
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks