]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/emptytable.h
some more random changes, added Timeout (make clean if LyX crashes !!)
[lyx.git] / src / frontends / qt2 / emptytable.h
1 /**
2  * \file emptytable.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #ifndef EMPTYTABLE_H
10 #define EMPTYTABLE_H
11
12 #include <qpainter.h> 
13 #include <qtableview.h> 
14
15 /**
16  * A simple widget for a quick "preview" in TabularCreateDialog.
17  * The user can drag on the widget to change the table dimensions.
18  */
19 class EmptyTable : public QTableView {
20         Q_OBJECT
21 public:
22         EmptyTable(QWidget * parent = 0, const char * name = 0);
23         
24         ~EmptyTable() {};
25
26 public slots:
27         /// set the number of columns in the table and emit colsChanged() signal 
28         void setNumberColumns(int nr_cols);
29         /// set the number of rows in the table and emit rowsChanged() signal 
30         void setNumberRows(int nr_rows);
31  
32 signals:
33         /// the number of columns changed
34         void colsChanged(int);
35         /// the number of rows changed
36         void rowsChanged(int);
37
38 protected:
39         /// fill in a cell
40         virtual void paintCell(class QPainter *, int, int);
41         virtual void mouseMoveEvent(QMouseEvent *);
42         
43 private:
44         /// number of current columns 
45         unsigned int cols;
46         /// number of current rows
47         unsigned int rows;
48 };
49
50 #endif