QtXlsxWriter
QtXlsxWriter copied to clipboard
setBorderColor, setBorderStyle does not work.
I am attempting to set the border style, and color of a cell to that of another cell, and nothing appears to happen.
Can you show some code of what you are doing?
auto xrayFormat = xray->cellAt(j,column)->format();
//reverse the border style of the cell pinside->cellAt(j,i)->format().setLeftBorderStyle(xrayFormat.rightBorderStyle()); pinside->cellAt(j,i)->format().setRightBorderStyle(xrayFormat.leftBorderStyle());
Everything compiles fine, but those lines do not change anything in the document. Everything else I am doing in the code executes fine.
This library uses the get/edit/set paradigm:
auto editFormat = pinside->cellAt(j,i)->format();
editFormat.setLeftBorderStyle(xrayFormat.rightBorderStyle());
editFormat.setRightBorderStyle(xrayFormat.leftBorderStyle());
pinside->cellAt(j,i)->setFormat(editFormat);
setFormat is not a member of Cell.
Yep, my fault, didn't check the docs. You have to use pinside->write
passing the format as parameter