* A simple widget for a quick "preview" in TabularCreateDialog
*/
-const unsigned int cellsize = 20;
+unsigned int const cellsize = 20;
+
EmptyTable::EmptyTable(QWidget * parent, const char * name)
: QtTableView(parent, name, WRepaintNoErase)
setTableFlags(Tbl_autoScrollBars);
}
+
QSize EmptyTable::sizeHint() const
{
return QSize(cellsize * numCols(), cellsize * numRows());
}
-void EmptyTable::paintCell(QPainter *p, int row, int col)
+void EmptyTable::paintCell(QPainter * p, int row, int col)
{
int const x2 = cellWidth(col) - 1;
int const y2 = cellHeight(row) - 1;
if (row + 1 != numRows() || col + 1 != numCols())
return;
-
+
// draw handle
int const step = cellsize / 5;
int const space = 4;
}
}
+
void EmptyTable::setNumberColumns(int nr_cols)
{
if (nr_cols < 1)
emit colsChanged(nr_cols);
}
+
void EmptyTable::setNumberRows(int nr_rows)
{
if (nr_rows < 1)
emit rowsChanged(nr_rows);
}
+
void EmptyTable::mouseMoveEvent(QMouseEvent *ev)
{
int const x = ev->pos().x();