#include <QToolTip>
#include <QToolBar>
#include <QApplication>
-#include <QDesktopWidget>
#include <QPainter>
+#include <QScreen>
#include <QStyle>
#include <QStyleOptionFrame>
#include <QMouseEvent>
#include <QVBoxLayout>
+#include <QWindow>
namespace lyx {
namespace frontend {
}
+#if QT_VERSION < 0x060000
void TearOff::enterEvent(QEvent * event)
+#else
+void TearOff::enterEvent(QEnterEvent * event)
+#endif
{
highlighted_ = true;
update();
menuOpt.checkType = QStyleOptionMenuItem::NotCheckable;
menuOpt.menuRect = rect();
menuOpt.maxIconWidth = 0;
+#if QT_VERSION < 0x060000
menuOpt.tabWidth = 0;
+#endif
menuOpt.menuItemType = QStyleOptionMenuItem::TearOff;
menuOpt.rect.setRect(fw, fw, width() - (fw * 2),
style()->pixelMetric(QStyle::PM_MenuTearoffHeight, 0, this));
: QWidget(parent, Qt::Popup), tornoff_(false)
{
QVBoxLayout * v = new QVBoxLayout(this);
- v->setMargin(0);
+ v->setContentsMargins(0, 0, 0, 0);
v->setSpacing(0);
layout_ = new QGridLayout;
layout_->setSpacing(0);
+#if QT_VERSION < 0x060000
const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, this);
layout_->setMargin(fw);
+#else
+ layout_->setContentsMargins(0, 0, 0, 0);
+#endif
tearoffwidget_ = new TearOff(this);
connect(tearoffwidget_, SIGNAL(tearOff()), this, SLOT(tearOff()));
v->addWidget(tearoffwidget_);
voffset -= parheight;
}
- QRect const screen = qApp->desktop()->availableGeometry(this);
+ QRect const screen = window()->windowHandle()->screen()->availableGeometry();
QPoint const gpos = parentWidget()->mapToGlobal(
parentWidget()->geometry().bottomLeft());