QtXlsxWriter icon indicating copy to clipboard operation
QtXlsxWriter copied to clipboard

setBorderColor, setBorderStyle does not work.

Open Twood1130 opened this issue 6 years ago • 6 comments

I am attempting to set the border style, and color of a cell to that of another cell, and nothing appears to happen.

Twood1130 avatar Jun 26 '18 12:06 Twood1130

Can you show some code of what you are doing?

VSRonin avatar Jul 02 '18 08:07 VSRonin

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());

Twood1130 avatar Jul 02 '18 10:07 Twood1130

Everything compiles fine, but those lines do not change anything in the document. Everything else I am doing in the code executes fine.

Twood1130 avatar Jul 02 '18 11:07 Twood1130

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);

VSRonin avatar Jul 02 '18 12:07 VSRonin

setFormat is not a member of Cell.

Twood1130 avatar Jul 02 '18 18:07 Twood1130

Yep, my fault, didn't check the docs. You have to use pinside->write passing the format as parameter

VSRonin avatar Jul 03 '18 15:07 VSRonin