本文整理汇总了C++中QTextTable::rows方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextTable::rows方法的具体用法?C++ QTextTable::rows怎么用?C++ QTextTable::rows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextTable
的用法示例。
在下文中一共展示了QTextTable::rows方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showTable
void MainWindow::showTable()
{
QTextCursor cursor = editor->textCursor();
QTextTable *table = cursor.currentTable();
if (!table)
return;
QTableWidget *tableWidget = new QTableWidget(table->rows(), table->columns());
//! [9]
for (int row = 0; row < table->rows(); ++row) {
for (int column = 0; column < table->columns(); ++column) {
QTextTableCell tableCell = table->cellAt(row, column);
//! [9]
QTextFrame::iterator it;
QString text;
for (it = tableCell.begin(); !(it.atEnd()); ++it) {
QTextBlock childBlock = it.currentBlock();
if (childBlock.isValid())
text += childBlock.text();
}
QTableWidgetItem *newItem = new QTableWidgetItem(text);
tableWidget->setItem(row, column, newItem);
/*
//! [10]
processTableCell(tableCell);
//! [10]
*/
//! [11]
}
//! [11] //! [12]
}
//! [12]
tableWidget->setWindowTitle(tr("Table Contents"));
tableWidget->show();
}
示例2: addFrameDecorations
void QQuickTextNodeEngine::addFrameDecorations(QTextDocument *document, QTextFrame *frame)
{
QTextDocumentLayout *documentLayout = qobject_cast<QTextDocumentLayout *>(document->documentLayout());
QTextFrameFormat frameFormat = frame->format().toFrameFormat();
QTextTable *table = qobject_cast<QTextTable *>(frame);
QRectF boundingRect = table == 0
? documentLayout->frameBoundingRect(frame)
: documentLayout->tableBoundingRect(table);
QBrush bg = frame->frameFormat().background();
if (bg.style() != Qt::NoBrush)
m_backgrounds.append(qMakePair(boundingRect, bg.color()));
if (!frameFormat.hasProperty(QTextFormat::FrameBorder))
return;
qreal borderWidth = frameFormat.border();
if (qFuzzyIsNull(borderWidth))
return;
QBrush borderBrush = frameFormat.borderBrush();
QTextFrameFormat::BorderStyle borderStyle = frameFormat.borderStyle();
if (borderStyle == QTextFrameFormat::BorderStyle_None)
return;
addBorder(boundingRect.adjusted(frameFormat.leftMargin(), frameFormat.topMargin(),
-frameFormat.rightMargin(), -frameFormat.bottomMargin()),
borderWidth, borderStyle, borderBrush);
if (table != 0) {
int rows = table->rows();
int columns = table->columns();
for (int row=0; row<rows; ++row) {
for (int column=0; column<columns; ++column) {
QTextTableCell cell = table->cellAt(row, column);
QRectF cellRect = documentLayout->tableCellBoundingRect(table, cell);
addBorder(cellRect.adjusted(-borderWidth, -borderWidth, 0, 0), borderWidth,
borderStyle, borderBrush);
}
}
}
}
示例3: insertCalendar
//! [5]
void MainWindow::insertCalendar()
{
editor->clear();
QTextCursor cursor = editor->textCursor();
cursor.beginEditBlock();
QDate date(selectedDate.year(), selectedDate.month(), 1);
//! [5]
//! [6]
QTextTableFormat tableFormat;
tableFormat.setAlignment(Qt::AlignHCenter);
tableFormat.setBackground(QColor("#e0e0e0"));
tableFormat.setCellPadding(2);
tableFormat.setCellSpacing(4);
//! [6] //! [7]
QVector<QTextLength> constraints;
constraints << QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14)
<< QTextLength(QTextLength::PercentageLength, 14);
tableFormat.setColumnWidthConstraints(constraints);
//! [7]
//! [8]
QTextTable *table = cursor.insertTable(1, 7, tableFormat);
//! [8]
//! [9]
QTextFrame *frame = cursor.currentFrame();
QTextFrameFormat frameFormat = frame->frameFormat();
frameFormat.setBorder(1);
frame->setFrameFormat(frameFormat);
//! [9]
//! [10]
QTextCharFormat format = cursor.charFormat();
format.setFontPointSize(fontSize);
QTextCharFormat boldFormat = format;
boldFormat.setFontWeight(QFont::Bold);
QTextCharFormat highlightedFormat = boldFormat;
highlightedFormat.setBackground(Qt::yellow);
//! [10]
//! [11]
for (int weekDay = 1; weekDay <= 7; ++weekDay) {
QTextTableCell cell = table->cellAt(0, weekDay-1);
//! [11] //! [12]
QTextCursor cellCursor = cell.firstCursorPosition();
cellCursor.insertText(QString("%1").arg(QDate::longDayName(weekDay)),
boldFormat);
}
//! [12]
//! [13]
table->insertRows(table->rows(), 1);
//! [13]
while (date.month() == selectedDate.month()) {
int weekDay = date.dayOfWeek();
QTextTableCell cell = table->cellAt(table->rows()-1, weekDay-1);
QTextCursor cellCursor = cell.firstCursorPosition();
if (date == QDate::currentDate())
cellCursor.insertText(QString("%1").arg(date.day()), highlightedFormat);
else
cellCursor.insertText(QString("%1").arg(date.day()), format);
date = date.addDays(1);
if (weekDay == 7 && date.month() == selectedDate.month())
table->insertRows(table->rows(), 1);
}
cursor.endEditBlock();
//! [14]
setWindowTitle(tr("Calendar for %1 %2"
).arg(QDate::longMonthName(selectedDate.month())
).arg(selectedDate.year()));
}
示例4: loadBody
void KoTextLoader::loadBody(const KoXmlElement &bodyElem, QTextCursor &cursor)
{
const QTextBlockFormat defaultBlockFormat = cursor.blockFormat();
const QTextCharFormat defaultCharFormat = cursor.charFormat();
const QTextDocument *document = cursor.block().document();
d->styleManager = KoTextDocument(document).styleManager();
Q_ASSERT(d->styleManager);
d->changeTracker = KoTextDocument(document).changeTracker();
// if (!d->changeTracker)
// d->changeTracker = dynamic_cast<KoChangeTracker *>(d->context.dataCenterMap().value("ChangeTracker"));
// Q_ASSERT(d->changeTracker);
kDebug(32500) << "text-style:" << KoTextDebug::textAttributes( cursor.blockCharFormat() );
#if 0
if ((document->isEmpty()) && (d->styleManager)) {
QTextBlock block = cursor.block();
d->styleManager->defaultParagraphStyle()->applyStyle(block);
}
#endif
startBody(KoXml::childNodesCount(bodyElem));
KoXmlElement tag;
bool usedParagraph = false; // set to true if we found a tag that used the paragraph, indicating that the next round needs to start a new one.
forEachElement(tag, bodyElem) {
if (! tag.isNull()) {
const QString localName = tag.localName();
if (tag.namespaceURI() == KoXmlNS::text) {
if (usedParagraph)
cursor.insertBlock(defaultBlockFormat, defaultCharFormat);
usedParagraph = true;
if (d->changeTracker && localName == "tracked-changes") {
d->changeTracker->loadOdfChanges(tag);
usedParagraph = false;
} else if (d->changeTracker && localName == "change-start") {
loadChangedRegion(tag, cursor);
usedParagraph = false;
} else if (d->changeTracker && localName == "change-end") {
d->currentChangeId = 0;
usedParagraph = false;
} else if (localName == "p") { // text paragraph
loadParagraph(tag, cursor);
} else if (localName == "h") { // heading
loadHeading(tag, cursor);
} else if (localName == "unordered-list" || localName == "ordered-list" // OOo-1.1
|| localName == "list" || localName == "numbered-paragraph") { // OASIS
loadList(tag, cursor);
} else if (localName == "section") { // Temporary support (###TODO)
loadSection(tag, cursor);
} else {
KoVariable *var = KoVariableRegistry::instance()->createFromOdf(tag, d->context);
if (var) {
KoTextDocumentLayout *layout = dynamic_cast<KoTextDocumentLayout*>(cursor.block().document()->documentLayout());
if (layout) {
KoInlineTextObjectManager *textObjectManager = layout->inlineTextObjectManager();
if (textObjectManager) {
KoVariableManager *varManager = textObjectManager->variableManager();
if (varManager) {
textObjectManager->insertInlineObject(cursor, var);
}
}
}
} else {
usedParagraph = false;
kWarning(32500) << "unhandled text:" << localName;
}
}
} else if (tag.namespaceURI() == KoXmlNS::draw) {
loadShape(tag, cursor);
} else if (tag.namespaceURI() == KoXmlNS::table) {
if (localName == "table") {
loadTable(tag, cursor);
} else {
kWarning(32500) << "unhandled table:" << localName;
}
#if 0 // TODO commented out for now
if (localName == "table") {
cursor.insertText("\n");
cursor.movePosition(QTextCursor::Left, QTextCursor::MoveAnchor, 1);
QTextTable *tbl = cursor.insertTable(1, 1);
int rows = 0;
int columns = 0;
kDebug(32500) << "Table inserted";
KoXmlElement tblTag;
forEachElement(tblTag, tag) {
if (! tblTag.isNull()) {
const QString tblLocalName = tblTag.localName();
if (tblTag.namespaceURI() == KoXmlNS::table) {
if (tblLocalName == "table-column") {
// Do some parsing with the column, see §8.2.1, ODF 1.1 spec
int repeatColumn = tblTag.attributeNS(KoXmlNS::table, "number-columns-repeated", "1").toInt();
columns = columns + repeatColumn;
if (rows > 0)
tbl->resize(rows, columns);
else
tbl->resize(1, columns);
} else if (tblLocalName == "table-row") {
// Lot of work to do here...
//.........这里部分代码省略.........
示例5: testTableDelete
void TestChangeTrackedDelete::testTableDelete()
{
TextTool *textTool = new TextTool(new MockCanvas);
KoTextEditor *textEditor = textTool->textEditor();
QVERIFY(textEditor);
QTextDocument *document = textEditor->document();
KTextDocumentLayout *layout = qobject_cast<KTextDocumentLayout*>(document->documentLayout());
QTextCursor *cursor = textEditor->cursor();
insertSampleTable(document);
cursor->setPosition(13);
cursor->setPosition(102, QTextCursor::KeepAnchor);
ChangeTrackedDeleteCommand *delCommand = new ChangeTrackedDeleteCommand(ChangeTrackedDeleteCommand::NextChar, textTool);
textEditor->addCommand(delCommand);
QCOMPARE(document->characterAt(13).unicode(), (ushort)(QChar::ObjectReplacementCharacter));
// This is wierd. Without this loop present the succeeding call to inlineTextObject returs NULL. Why ??????
for (int i=0; i<document->characterCount(); i++) {
cursor->setPosition(i);
}
cursor->setPosition(14);
KDeleteChangeMarker *testMarker = dynamic_cast<KDeleteChangeMarker*>(layout->inlineTextObjectManager()->inlineTextObject(*cursor));
QTextDocumentFragment deleteData = KTextDocument(document).changeTracker()->elementById(testMarker->changeId())->deleteData();
QTextDocument deleteDocument;
QTextCursor deleteCursor(&deleteDocument);
deleteCursor.insertFragment(deleteData);
bool tableFound = false;
for (int i=0; i < deleteDocument.characterCount(); i++) {
deleteCursor.setPosition(i);
if (deleteCursor.currentTable()) {
tableFound = true;
break;
}
}
QVERIFY(tableFound == true);
QTextTable *table = deleteCursor.currentTable();
QVERIFY(table->rows() == 3);
QVERIFY(table->columns() == 3);
tableFound = false;
for (int i=0; i < document->characterCount(); i++) {
deleteCursor.setPosition(i);
if (deleteCursor.currentTable()) {
tableFound = true;
break;
}
}
QVERIFY(tableFound == false);
delCommand->undo();
tableFound = false;
for (int i=0; i < document->characterCount(); i++) {
deleteCursor.setPosition(i);
if (deleteCursor.currentTable()) {
tableFound = true;
break;
}
}
QVERIFY(tableFound == true);
delete textTool;
}
示例6: fillTable
///////////////////////////////////////////////////////////////////////////////////
//fin modele-----------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////////
void ProduceDoc::fillTable(QList<QVector<QString> > & tableau,
QTextTableFormat & tableFormatOrganized,
QTextCursor * cursorForFillFunction,
QString & thisMonth,
QStringList & listSums,
int choice,
const QString & totalMovementString){
QList<QVector<QString> > tableauInFonction;
tableauInFonction = tableau;
int nbreLignesTableau = tableauInFonction.size();
int nbreColonnesTableau = TABLE_NAME_OF_ACTS;
int sizeOfTable = nbreLignesTableau*nbreColonnesTableau;
QTextTableFormat tableFormat = tableFormatOrganized;
QTextCursor *cursortrieinfunction = cursorForFillFunction;
QString thisMonthfonction = thisMonth;
QString type = "";
QStringList totalSumsList = listSums;
QString total;
/*for (int i = 0; i < totalSumsList.size(); i += 1)
{
if (WarnDebugMessage)
qDebug() << __FILE__ << QString::number(__LINE__) << " totalSumsList =" << totalSumsList[i] ;
}*/
if(choice == RECEIPTS_TYPE){
type = tr("Receipts");
total = totalSumsList[SUMS_SUM];
}
if(choice == MOVEMENTS_TYPE){
type = tr("Movements");
total = totalMovementString;
}
QTextBlockFormat centerHead ;
//centrer .setBackground(Qt::yellow) ;
if (WarnDebugMessage)
qDebug() << __FILE__ << QString::number(__LINE__) << " thisMonthfonction =" << thisMonthfonction ;
QString heads = tr("Month of ")+thisMonthfonction+" = "+type;
if (thisMonthfonction == tr("complete year"))
{
heads = tr("Total of ")+thisMonthfonction+" = "+type;
}
centerHead .setAlignment(Qt::AlignCenter) ;
cursortrieinfunction -> insertBlock(centerHead);
cursortrieinfunction -> insertHtml("<font size = 6 color = #3300FF><bold><br/>"
"<br/>"+heads+"<bold>"
"</font><br/><br/>");
QTextTableFormat tableFormatDone;
myFormat(tableFormatDone,m_tablesRecapParameters);
if (WarnDebugMessage)
qDebug() << __FILE__ << QString::number(__LINE__) << " thread 10 " ;
if(sizeOfTable!= 0){
if((thisMonthfonction != tr("complete year")) ){
QTextTable * table = cursortrieinfunction->insertTable(nbreLignesTableau,
nbreColonnesTableau,
tableFormat);
for(int i=0 ; i< nbreLignesTableau ; i++){
QVector<QString> vectorString;
vectorString = tableauInFonction[i];
/*if (WarnDebugMessage)
qDebug() << __FILE__ << QString::number(__LINE__) << "vectorString size ="
<< QString::number(vectorString.size());*/
QStringList list; // liste des données de la ligne
/*if (WarnDebugMessage)
qDebug() << __FILE__ << QString::number(__LINE__) << "nbreColonnesTableau = "
<< QString::number(nbreColonnesTableau) ;*/
for (int a = 0 ;a < nbreColonnesTableau ; a++){
QString str = vectorString[a];
list << str;
if (WarnDebugMessage)
qDebug() << __FILE__ << QString::number(__LINE__) << " str =" << str ;
}
double s = list[2].toDouble();
if(s > 0){
for(int j= 0 ; j < nbreColonnesTableau ; j++){
QTextTableCell cell = table->cellAt(i,j);
QTextCursor cellCursor = cell.firstCursorPosition();
cellCursor . insertText(list[j]);
}
}
}
QTextBlockFormat centrer ;
//centrer .setBackground(Qt::yellow) ;
centrer .setAlignment(Qt::AlignCenter) ;
cursortrieinfunction -> insertBlock(centrer);
cursortrieinfunction -> insertText("\n\n");
//----------------insertion fin de table-------------------------------------------
if (WarnDebugMessage)
qDebug() << __FILE__ << QString::number(__LINE__) << "total =" << total ;
table -> insertRows(table->rows(),1);
table -> mergeCells(table->rows()-1,0,1,2);//-1 car part de zero
QTextTableCell cell = table->cellAt(table->rows()-1,0);
QTextCursor cellCursor = cell.firstCursorPosition();
QString totalMonth = QString("<html><font size = 4 color = #FF0000><bold>%1 %2 <bold></font></html>")
.arg(tr("Total of "),thisMonthfonction);
//.........这里部分代码省略.........
示例7: hacerResumen
void InformeCierreCaja::hacerResumen( int id_caja, bool ultimo, int id_cierre )
{
if( id_caja == -1 ) {
qWarning( "Numero de caja incorrecto" );
//abort();
return;
} else if( ultimo == false && id_cierre == -1 ) {
qWarning( "El cierre pedido es incorrecto" );
//abort();
return;
}
// Busco los datos
MMovimientosCaja *m = new MMovimientosCaja( this );
if( ultimo ) {
id_cierre = m->buscarUltimoCierre( id_caja );
if( id_cierre == -1 ) {
return;
}
}
QSqlQuery resultados = m->buscarMovimientos( id_caja, id_cierre );
///////////////////////////////////////////////////////////////////////////////////////////////////
// Inicio el renderizado
QTextCursor cursor( documento );
int cantidadCol = 6;
if( preferencias::getInstancia()->value( "Preferencias/Caja/responsable", true ).toBool() ) { cantidadCol++; }
/////////////////////////////////////
/// Hago la cabecera de la tabla
QTextTable *tabla = cursor.insertTable( 1, cantidadCol );
QTextTableFormat formatoTabla = tabla->format();
formatoTabla.setHeaderRowCount( 1 );
formatoTabla.setWidth( QTextLength( QTextLength::PercentageLength, 100 ) );
tabla->setFormat( formatoTabla );
tabla->cellAt( 0,0 ).firstCursorPosition().insertHtml( " # Op " );
tabla->cellAt( 0,1 ).firstCursorPosition().insertHtml( " Fecha/Hora " );
tabla->cellAt( 0,2 ).firstCursorPosition().insertHtml( " Razon " );
tabla->cellAt( 0,3 ).firstCursorPosition().insertHtml( " Ingreso " );
tabla->cellAt( 0,4 ).firstCursorPosition().insertHtml( " Egreso " );
tabla->cellAt( 0,5 ).firstCursorPosition().insertHtml( " Saldo " );
if( preferencias::getInstancia()->value( "Preferencias/Caja/responsable", true ).toBool() ) {
tabla->cellAt( 0, 6 ).firstCursorPosition().insertHtml( " Responsable " );
}
// Averiguo el saldo hasta el momento del cierre anterior
double saldo_anterior = m->saldoEnMovimientoAnteriorA( id_caja, id_cierre );
while( resultados.next() ) {
int pos = tabla->rows();
tabla->insertRows( pos, 1 );
tabla->cellAt( pos, 0 ).firstCursorPosition().insertHtml( QString( " # %1 " ).arg( resultados.record().value("id_movimiento" ).toInt() ) );
tabla->cellAt( pos, 1 ).firstCursorPosition().insertHtml( resultados.record().value("fecha_hora" ).toDateTime().toString( Qt::SystemLocaleDate ) );
tabla->cellAt( pos, 2 ).firstCursorPosition().insertHtml( resultados.record().value("razon" ).toString() );
if( resultados.record().value( "cierre" ).toBool() == false ) {
// Ingreso
double haber = resultados.record().value( "ingreso" ).toDouble();
saldo_anterior += haber;
tabla->cellAt( pos, 3 ).firstCursorPosition().insertHtml( QString( " $ %L1" ).arg( haber ) );
// Egreso
double debe = resultados.record().value( "egreso" ).toDouble();
saldo_anterior -= debe;
tabla->cellAt( pos, 4 ).firstCursorPosition().insertHtml( QString( " $ %L1" ).arg( debe ) );
// Subtotal hasta el momento
tabla->cellAt( pos, 5 ).firstCursorPosition().insertHtml( QString( " $ %L1" ).arg( saldo_anterior ) );
} else {
saldo_anterior += resultados.record().value( "ingreso" ).toDouble();
tabla->cellAt( pos, 5 ).firstCursorPosition().insertHtml( QString( " $ %L1" ).arg( saldo_anterior ) );
}
if( preferencias::getInstancia()->value( "Preferencias/Caja/responsable", true ).toBool() ) {
tabla->cellAt( pos, 6 ).firstCursorPosition().insertHtml( resultados.record().value( "responsable" ).toString() );
}
}
// Saldos finales
cursor.movePosition( QTextCursor::End );
cursor.insertBlock();
cursor.insertHtml( QString( "<b>Saldo Final:</b> $ %L1" ).arg( saldo_anterior ) );
cursor.insertBlock();
if( preferencias::getInstancia()->value( "Preferencias/Caja/firma", true ).toBool() ) {
cursor.insertBlock();
cursor.insertText( "Controlado por: ________________________" );
cursor.insertBlock();
cursor.insertBlock();
cursor.insertText( "Firma: ____________" );
}
// Termino el resumen
cursor.movePosition( QTextCursor::Start );
cursor.insertBlock();
if( preferencias::getInstancia()->value( "Preferencias/Caja/logo" ).toBool() ) {
//cursor.insertImage( ERegistroPlugins::pluginInfo()->imagenPrograma() );
cursor.insertImage( ":/imagenes/gestotux32.png" );
}
cursor.insertHtml( "<h1>Cierre de Caja</h1>" );
cursor.insertBlock();
cursor.insertHtml( QString( "<b>Fecha de Cierre:</b> %1 <br />" ).arg( QDateTime::currentDateTime().toString( Qt::SystemLocaleLongDate ) ) );
cursor.insertHtml( QString( "<b>Caja:</b> %1<br />").arg( MCajas::nombreCaja( id_caja ) ) );
return;
}
示例8: write
void KoTextWriter::write(const QTextDocument *document, int from, int to)
{
d->document = const_cast<QTextDocument*>(document);
d->styleManager = KoTextDocument(document).styleManager();
QTextBlock fromblock = document->findBlock(from);
QTextBlock toblock = document->findBlock(to);
QTextCursor fromcursor(fromblock);
QTextTable *currentTable = fromcursor.currentTable();
QTextList *currentList = fromcursor.currentList();
// NOTE even better would be if we create a new table/list out of multiple selected
// tablecells/listitems that contain only the selected cells/items. But following
// at least enables copying a whole list/table while still being able to copy/paste
// only parts of the text within a list/table (see also bug 275990).
if (currentTable || currentList) {
if (from == 0 && to < 0) {
// save everything means also save current table and list
currentTable = 0;
currentList = 0;
} else {
QTextCursor tocursor(toblock);
//fromcursor.setPosition(from, QTextCursor::KeepAnchor);
tocursor.setPosition(to, QTextCursor::KeepAnchor);
if (!fromcursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor)) {
fromcursor = QTextCursor();
}
if (!tocursor.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor)) {
tocursor = QTextCursor();
}
// save the whole table if all cells are selected
if (currentTable) {
QTextTableCell fromcell = currentTable->cellAt(from);
QTextTableCell tocell = currentTable->cellAt(to);
if ((fromcursor.isNull() || fromcursor.currentTable() != currentTable) &&
(tocursor.isNull() || tocursor.currentTable() != currentTable) &&
fromcell.column() == 0 && fromcell.row() == 0 &&
tocell.column() == currentTable->columns()-1 && tocell.row() == currentTable->rows()-1
) {
currentTable = 0;
}
}
// save the whole list if all list-items are selected
if (currentList) {
int fromindex = currentList->itemNumber(fromblock);
int toindex = currentList->itemNumber(toblock);
if ((fromcursor.isNull() || fromcursor.currentList() != currentList) &&
(tocursor.isNull() || tocursor.currentList() != currentList) &&
fromindex <= 0 && (toindex < 0 || toindex == currentList->count()-1)
) {
currentList = 0;
}
}
}
}
QHash<QTextList *, QString> listStyles = d->saveListStyles(fromblock, to);
d->globalFrom = from;
d->globalTo = to;
d->writeBlocks(const_cast<QTextDocument *>(document), from, to, listStyles, currentTable, currentList);
}