]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/emptytable.h
some tabular fixes for the problems reported by Helge
[lyx.git] / src / frontends / qt2 / 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 "qttableview.h"
16
17 /**
18  * A simple widget for a quick "preview" in TabularCreateDialog.
19  * The user can drag on the widget to change the table dimensions.
20  */
21 class EmptyTable : public QtTableView {
22         Q_OBJECT
23 public:
24         EmptyTable(QWidget * parent = 0, const char * name = 0);
25
26         ~EmptyTable() {}
27
28         virtual QSize sizeHint() const;
29 public slots:
30         /// set the number of columns in the table and emit colsChanged() signal
31         void setNumberColumns(int nr_cols);
32         /// set the number of rows in the table and emit rowsChanged() signal
33         void setNumberRows(int nr_rows);
34 signals:
35         /// the number of columns changed
36         void colsChanged(int);
37         /// the number of rows changed
38         void rowsChanged(int);
39 protected:
40         /// fill in a cell
41         virtual void paintCell(class QPainter *, int, int);
42         virtual void mouseMoveEvent(QMouseEvent *);
43 private:
44         /// number of current columns
45         unsigned int cols;
46         /// number of current rows
47         unsigned int rows;
48 };
49
50 #endif