]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt/IconPalette.cpp
Fix readability
[lyx.git] / src / frontends / qt / IconPalette.cpp
index 8956a48c96fbf42cd22ec8dc046d2374458217c3..7a5b1f33331e26e064f040ebc7bf3b9f12f67c9b 100644 (file)
 #include <QToolTip>
 #include <QToolBar>
 #include <QApplication>
-#if QT_VERSION < 0x060000
-#include <QDesktopWidget>
-#endif
 #include <QPainter>
+#include <QScreen>
 #include <QStyle>
 #include <QStyleOptionFrame>
 #include <QMouseEvent>
@@ -52,7 +50,11 @@ void TearOff::mouseReleaseEvent(QMouseEvent * /*event*/)
 }
 
 
+#if QT_VERSION < 0x060000
 void TearOff::enterEvent(QEvent * event)
+#else
+void TearOff::enterEvent(QEnterEvent * event)
+#endif
 {
        highlighted_ = true;
        update();
@@ -97,16 +99,12 @@ IconPalette::IconPalette(QWidget * parent)
        : QWidget(parent, Qt::Popup), tornoff_(false)
 {
        QVBoxLayout * v = new QVBoxLayout(this);
-#if QT_VERSION < 0x060000
-       v->setMargin(0);
-#else
        v->setContentsMargins(0, 0, 0, 0);
-#endif
        v->setSpacing(0);
        layout_ = new QGridLayout;
        layout_->setSpacing(0);
-       const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, this);
 #if QT_VERSION < 0x060000
+       const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, this);
        layout_->setMargin(fw);
 #else
        layout_->setContentsMargins(0, 0, 0, 0);
@@ -179,11 +177,7 @@ void IconPalette::showEvent(QShowEvent * /*event*/)
                voffset -= parheight;
        }
 
-#if QT_VERSION < 0x060000
-       QRect const screen = qApp->desktop()->availableGeometry(this);
-#else
        QRect const screen = window()->windowHandle()->screen()->availableGeometry();
-#endif
        QPoint const gpos = parentWidget()->mapToGlobal(
                parentWidget()->geometry().bottomLeft());