2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-26 03:53:02 +00:00
|
|
|
* \file EmptyTable.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
2015-05-02 09:38:46 +00:00
|
|
|
* \author Jürgen Spitzmüller
|
2006-03-05 17:24:44 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EMPTYTABLE_H
|
|
|
|
#define EMPTYTABLE_H
|
|
|
|
|
|
|
|
#include <QTableWidget>
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
class QMouseEvent;
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
//namespace lyx {
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/**
|
|
|
|
* A simple widget for a quick "preview" in TabularCreateDialog.
|
|
|
|
* The user can drag on the widget to change the table dimensions.
|
|
|
|
*/
|
|
|
|
class EmptyTable : public QTableWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
EmptyTable(QWidget * parent = 0, int rows = 5, int columns = 5);
|
|
|
|
|
2020-10-04 14:56:53 +00:00
|
|
|
QSize sizeHint() const override;
|
2006-06-30 14:37:33 +00:00
|
|
|
public Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
/// set the number of columns in the table and emit colsChanged() signal
|
|
|
|
void setNumberColumns(int nr_cols);
|
|
|
|
/// set the number of rows in the table and emit rowsChanged() signal
|
|
|
|
void setNumberRows(int nr_rows);
|
2006-06-30 14:37:33 +00:00
|
|
|
Q_SIGNALS:
|
2006-03-05 17:24:44 +00:00
|
|
|
/// the number of columns changed
|
|
|
|
void colsChanged(int);
|
|
|
|
/// the number of rows changed
|
|
|
|
void rowsChanged(int);
|
|
|
|
protected:
|
|
|
|
/// fill in a cell
|
|
|
|
virtual void paintCell(class QPainter *, int, int);
|
2020-10-04 14:56:53 +00:00
|
|
|
void mouseMoveEvent(QMouseEvent *) override;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
/// Reset all the cell size to default
|
|
|
|
virtual void resetCellSize();
|
|
|
|
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
//} // namespace lyx
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#endif
|