]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/emptytable.h
Some string(widget->text()) fixes. Weirdness
[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 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include <qpainter.h>
20 #include "qttableview.h"
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 QtTableView {
27         Q_OBJECT
28 public:
29         EmptyTable(QWidget * parent = 0, const char * name = 0);
30
31         ~EmptyTable() {}
32
33         virtual QSize sizeHint() const;
34 public slots:
35         /// set the number of columns in the table and emit colsChanged() signal
36         void setNumberColumns(int nr_cols);
37         /// set the number of rows in the table and emit rowsChanged() signal
38         void setNumberRows(int nr_rows);
39 signals:
40         /// the number of columns changed
41         void colsChanged(int);
42         /// the number of rows changed
43         void rowsChanged(int);
44 protected:
45         /// fill in a cell
46         virtual void paintCell(class QPainter *, int, int);
47         virtual void mouseMoveEvent(QMouseEvent *);
48 private:
49         /// number of current columns
50         unsigned int cols;
51         /// number of current rows
52         unsigned int rows;
53 };
54
55 #endif