]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/emptytable.h
Some Qt graphics dialog improvements. Yet more work needed :/
[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 "qttableview.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 QtTableView {
20         Q_OBJECT
21 public:
22         EmptyTable(QWidget * parent = 0, const char * name = 0);
23
24         ~EmptyTable() {};
25
26         virtual QSize sizeHint() const;
27
28 public slots:
29         /// set the number of columns in the table and emit colsChanged() signal
30         void setNumberColumns(int nr_cols);
31         /// set the number of rows in the table and emit rowsChanged() signal
32         void setNumberRows(int nr_rows);
33
34 signals:
35         /// the number of columns changed
36         void colsChanged(int);
37         /// the number of rows changed
38         void rowsChanged(int);
39
40 protected:
41         /// fill in a cell
42         virtual void paintCell(class QPainter *, int, int);
43         virtual void mouseMoveEvent(QMouseEvent *);
44
45 private:
46         /// number of current columns
47         unsigned int cols;
48         /// number of current rows
49         unsigned int rows;
50 };
51
52 #endif