29 lines
752 B
C++
29 lines
752 B
C++
#pragma once
|
|
|
|
#include <QPoint>
|
|
#include <QString>
|
|
#include <QVector>
|
|
|
|
namespace Cevo {
|
|
|
|
// Equivalent of StringTable.pas's TStringTable: a resizable 2D string grid.
|
|
class StringTable {
|
|
public:
|
|
QString cell(int x, int y) const { return m_cells.at(y).at(x); }
|
|
void setCell(int x, int y, const QString &value) { m_cells[y][x] = value; }
|
|
|
|
int colCount() const { return m_size.x(); }
|
|
void setColCount(int value) { setSize(QPoint(value, rowCount())); }
|
|
int rowCount() const { return m_size.y(); }
|
|
void setRowCount(int value) { setSize(QPoint(colCount(), value)); }
|
|
|
|
QPoint size() const { return m_size; }
|
|
void setSize(QPoint value);
|
|
|
|
private:
|
|
QVector<QVector<QString>> m_cells;
|
|
QPoint m_size;
|
|
};
|
|
|
|
} // namespace Cevo
|