3 * \file InsertTableWidget.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
13 #ifndef INSERTTABLEWIDGET_H
14 #define INSERTTABLEWIDGET_H
17 #include <QProxyStyle>
24 // A proxy style to get rif of the style-specific tool tip delay
25 // (https://forum.qt.io/topic/90403/show-tooltip-immediatly/6)
26 class ProxyStyle : public QProxyStyle
29 using QProxyStyle::QProxyStyle;
30 int styleHint(StyleHint hint, const QStyleOption * option = nullptr,
31 const QWidget* widget = nullptr,
32 QStyleHintReturn* returnData = nullptr) const override
34 if (hint == QStyle::SH_ToolTip_WakeUpDelay)
36 else if (hint == QStyle::SH_ToolTip_FallAsleepDelay)
38 return QProxyStyle::styleHint(hint, option, widget, returnData);
42 class InsertTableWidget : public QWidget {
46 InsertTableWidget(QWidget *);
55 //! enable/disable parent
59 void mouseMoveEvent(QMouseEvent *) override;
60 void mouseReleaseEvent(QMouseEvent *) override;
61 void mousePressEvent(QMouseEvent *) override;
62 void paintEvent(QPaintEvent *) override;
63 void hideEvent(QHideEvent * event) override;
66 //! update the geometry
68 //! initialize parameters to default values
71 void drawGrid(int rows, int cols, QBrush fillBrush, QColor lineColor);
73 //! colwidth in pixels
75 //! rowheight in pixels
79 //! minimum number of rows
83 //! minimum number of cols
89 //! widget under mouse
93 } // namespace frontend
96 #endif // INSERTTABLEWIDGET_H