]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/EmptyTable.h
* fix spelling in comments to please John.
[lyx.git] / src / frontends / qt4 / EmptyTable.h
1 // -*- C++ -*-
2 /**
3  * \file EmptyTable.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef EMPTYTABLE_H
13 #define EMPTYTABLE_H
14
15 #include <QTableWidget>
16
17
18 class QMouseEvent;
19
20 //namespace lyx {
21
22 /**
23  * A simple widget for a quick "preview" in TabularCreateDialog.
24  * The user can drag on the widget to change the table dimensions.
25  */
26 class EmptyTable : public QTableWidget {
27         Q_OBJECT
28 public:
29         EmptyTable(QWidget * parent = 0, int rows = 5, int columns = 5);
30
31         virtual QSize sizeHint() const;
32 public Q_SLOTS:
33         /// set the number of columns in the table and emit colsChanged() signal
34         void setNumberColumns(int nr_cols);
35         /// set the number of rows in the table and emit rowsChanged() signal
36         void setNumberRows(int nr_rows);
37 Q_SIGNALS:
38         /// the number of columns changed
39         void colsChanged(int);
40         /// the number of rows changed
41         void rowsChanged(int);
42 protected:
43         /// fill in a cell
44         virtual void paintCell(class QPainter *, int, int);
45 //      virtual void mouseMoveEvent(QMouseEvent *);
46
47         /// Reset all the cell size to default
48         virtual void resetCellSize();
49
50 private:
51         /// number of current columns
52         unsigned int cols;
53         /// number of current rows
54         unsigned int rows;
55
56 };
57
58
59 //} // namespace lyx
60
61 #endif