Example (in Ruby) :
doc = krosskspreadcore::get("KSpreadDocument") sheet1 = doc.sheetByName("Sheet1") sheet2 = doc.sheetByName("Sheet2") cell1 = sheet1.firstCell() while cell1 colnr = cell1.column() rownr = cell1.row() cell2 = sheet2.cell(colnr, rownr) cell2.setValue( cell1.value() ) cell1 = cell1.nextCell() end
Private Member Functions | |
| const QString | name () const |
| void | setName (const QString &name) |
| int | maxColumn () const |
| int | maxRow () const |
| Cell * | firstCell () const |
| Cell * | cell (uint col, uint row) |
| bool | insertRow (uint row) |
| bool | insertColumn (uint col) |
| void | removeRow (uint row) |
| void | removeColumn (uint col) |
| Cell * cell | ( | uint | col, | |
| uint | row | |||
| ) | [private] |
Return the given cell. The first parameter is the column-number while the second defines the rownumber. The first cell starts with 0,0. If you like to iterate over all cells that have content, use the firstCell() and nextCell() methods which is much faster cause empty cells are ignored.
Example (in Python) :
import krosskspreadcore doc = krosskspreadcore.get("KSpreadDocument") sheet = doc.currentSheet() for colnr in range( sheet.maxColumn() ): for rownr in range( sheet.maxRow() ): cell = sheet.cell(colnr, rownr) if cell.value() != None: print "Cell col=%s row=%s value=%s" % (colnr,rownr,cell.value())
| Cell * firstCell | ( | ) | const [private] |
Return the first cell. Use the firstCell() and nextCell() methods as outlined in the example to iterate only through filled cells (aka cells with content).
Example (in Python) :
import krosskspreadcore doc = krosskspreadcore.get("KSpreadDocument") sheet = doc.currentSheet() cell = sheet.firstCell() while cell: print "Cell col=%s row=%s value=%s" % (cell.column(),cell.row(),cell.value()) cell = cell.nextCell()
| bool insertColumn | ( | uint | col | ) | [private] |
Add a new column.
| bool insertRow | ( | uint | row | ) | [private] |
Add a new row.
| int maxColumn | ( | ) | const [private] |
Return the currently maximum defined number of columns.
| int maxRow | ( | ) | const [private] |
Return the currently maximum defined number of rows.
| const QString name | ( | ) | const [private] |
Return the name of the sheet.
| void removeColumn | ( | uint | col | ) | [private] |
Remove a column.
| void removeRow | ( | uint | row | ) | [private] |
Remove a row.
| void setName | ( | const QString & | name | ) | [private] |
Set the name of the sheet.
1.4.7