2002-09-24 13:57:09 +00:00
|
|
|
// -*- C++ -*-
|
2001-06-05 17:05:51 +00:00
|
|
|
/**
|
|
|
|
* \file emptytable.h
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-06-05 17:05:51 +00:00
|
|
|
*
|
|
|
|
* \author John Levon
|
2002-09-24 13:57:09 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2001-02-14 19:43:56 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EMPTYTABLE_H
|
|
|
|
#define EMPTYTABLE_H
|
|
|
|
|
2001-12-01 02:24:28 +00:00
|
|
|
#include "qttableview.h"
|
2001-02-14 19:43:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A simple widget for a quick "preview" in TabularCreateDialog.
|
|
|
|
* The user can drag on the widget to change the table dimensions.
|
|
|
|
*/
|
2001-12-01 02:24:28 +00:00
|
|
|
class EmptyTable : public QtTableView {
|
2001-06-05 17:05:51 +00:00
|
|
|
Q_OBJECT
|
2001-02-14 19:43:56 +00:00
|
|
|
public:
|
|
|
|
EmptyTable(QWidget * parent = 0, const char * name = 0);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2002-10-20 01:48:28 +00:00
|
|
|
~EmptyTable() {}
|
2001-02-14 19:43:56 +00:00
|
|
|
|
2001-08-31 03:01:11 +00:00
|
|
|
virtual QSize sizeHint() const;
|
2001-02-14 19:43:56 +00:00
|
|
|
public slots:
|
2002-03-21 21:21:28 +00:00
|
|
|
/// set the number of columns in the table and emit colsChanged() signal
|
2001-02-14 19:43:56 +00:00
|
|
|
void setNumberColumns(int nr_cols);
|
2002-03-21 21:21:28 +00:00
|
|
|
/// set the number of rows in the table and emit rowsChanged() signal
|
2001-02-14 19:43:56 +00:00
|
|
|
void setNumberRows(int nr_rows);
|
|
|
|
signals:
|
|
|
|
/// the number of columns changed
|
|
|
|
void colsChanged(int);
|
|
|
|
/// the number of rows changed
|
|
|
|
void rowsChanged(int);
|
|
|
|
protected:
|
|
|
|
/// fill in a cell
|
|
|
|
virtual void paintCell(class QPainter *, int, int);
|
|
|
|
virtual void mouseMoveEvent(QMouseEvent *);
|
|
|
|
private:
|
2002-03-21 21:21:28 +00:00
|
|
|
/// number of current columns
|
2001-02-14 19:43:56 +00:00
|
|
|
unsigned int cols;
|
|
|
|
/// number of current rows
|
|
|
|
unsigned int rows;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|