QtextTable draw your own boarders
Hello,
I have a text atble i removed the boarders because i want to draw my own.
i want to look like thisAttachment 8478
any one know how to do this.
here is the code if need be
Code:
// editor->setDocumentMargin(25);
//creates writing format
NormalFormat.
setFont(QFont("Helvetica",
20,
QFont::Bold));
block.setAlignment(Qt::AlignBottom);
//create pointer to current cursor location
cursor.beginEditBlock();
cursor.setBlockFormat(block);
cursor.insertBlock();
cursor.insertBlock();
cursor.insertBlock();
cursor.insertText(" ",NormalFormat);
cursor.insertText("Escort Data Logger Report",NormalFormat);
cursor.insertBlock();
cursor.insertBlock();
cursor.insertBlock();
tableFormat.
setBackground(QColor("#ffffff"));
tableFormat.setBorder(0);
tableFormat.setCellPadding(2);
tableFormat.setCellSpacing(4);
QTextTable *tab
=cursor.
insertTable(tabW
->rowCount
()+1,tabW
->columnCount
(),tableFormat
);
cursor.insertFrame(frameFormat);
cursor.setPosition(frame->lastPosition());
frame->setFrameFormat(frameFormat);
format_entete_tab.setFontPointSize(15);
format_entete_tab.
setFontWeight(QFont::Bold);
format_cellule.setFontPointSize(12);
for(int i=0;i<tabW->columnCount();i++)
{
QTextTableCell titre
= tab
->cellAt
(0,i
);
// change 0 it moves the title cellCursor.insertText(tabW->horizontalHeaderItem(i)->text(),format_entete_tab);
}
for(int row=1;row<tab->rows();row++)
{
for(int col=0;col<tab->columns();col++)
{
cell=tab->cellAt(row,col);
cellCursor=cell.firstCursorPosition();
cellCursor.insertText(tr("%1").arg(tabW->item(row-1,col)->text()),format_cellule);
}
}
cursor.endEditBlock();