]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/InsertTableWidget.cpp
Fix readability
[lyx.git] / src / frontends / qt / InsertTableWidget.cpp
index 07ae06124f4dd3bd0b16a8880b06d66251e20559..45855274a830f752b27f0c0f3655e09fd28212a0 100644 (file)
@@ -37,6 +37,8 @@ InsertTableWidget::InsertTableWidget(QWidget * parent)
 {
        init();
        setMouseTracking(true);
+       // display tooltip without any delay
+       setStyle(new ProxyStyle(style()));
 }
 
 
@@ -63,6 +65,13 @@ void InsertTableWidget::show(bool show)
 }
 
 
+void InsertTableWidget::hideEvent(QHideEvent * event)
+{
+       QWidget::hideEvent(event);
+       visible(false);
+}
+
+
 void InsertTableWidget::resetGeometry()
 {
        QPoint p = parentWidget()->mapToGlobal(parentWidget()->geometry().bottomLeft());
@@ -113,11 +122,7 @@ void InsertTableWidget::mouseMoveEvent(QMouseEvent * event)
        if (bottom_ != b0 || right_ != r0) {
                update();
                QString const status = QString("%1x%2").arg(bottom_).arg(right_);
-#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
-               QToolTip::showText(event->globalPosition().toPoint(), status , this);
-#else
-               QToolTip::showText(event->globalPos(), status , this);
-#endif
+               setToolTip(status);
        }
 }