don't use QCursor if QT_NO_CURSOR
to support configure -no-feature-CURSOR Change-Id: I8e7f9a7f80d3d44a1f8e25b909d552351b5f37e4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
f96cd3187d
commit
7dcbd519c4
@ -207,7 +207,9 @@ QMouseEvent::QMouseEvent(Type type, const QPointF &localPos, Qt::MouseButton but
|
|||||||
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
|
Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
|
||||||
: QInputEvent(type, modifiers), l(localPos), w(localPos), b(button), mouseState(buttons), caps(0)
|
: QInputEvent(type, modifiers), l(localPos), w(localPos), b(button), mouseState(buttons), caps(0)
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_CURSOR
|
||||||
s = QCursor::pos();
|
s = QCursor::pos();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1545,7 +1547,9 @@ QContextMenuEvent::~QContextMenuEvent()
|
|||||||
QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos)
|
QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos)
|
||||||
: QInputEvent(ContextMenu), p(pos), reas(reason)
|
: QInputEvent(ContextMenu), p(pos), reas(reason)
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_CURSOR
|
||||||
gp = QCursor::pos();
|
gp = QCursor::pos();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -526,12 +526,14 @@ static inline const QScreen *effectiveScreen(const QWindow *window)
|
|||||||
if (!screen)
|
if (!screen)
|
||||||
return QGuiApplication::primaryScreen();
|
return QGuiApplication::primaryScreen();
|
||||||
const QList<QScreen *> siblings = screen->virtualSiblings();
|
const QList<QScreen *> siblings = screen->virtualSiblings();
|
||||||
|
#ifndef QT_NO_CURSOR
|
||||||
if (siblings.size() > 1) {
|
if (siblings.size() > 1) {
|
||||||
const QPoint referencePoint = window->transientParent() ? window->transientParent()->geometry().center() : QCursor::pos();
|
const QPoint referencePoint = window->transientParent() ? window->transientParent()->geometry().center() : QCursor::pos();
|
||||||
foreach (const QScreen *sibling, siblings)
|
foreach (const QScreen *sibling, siblings)
|
||||||
if (sibling->geometry().contains(referencePoint))
|
if (sibling->geometry().contains(referencePoint))
|
||||||
return sibling;
|
return sibling;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return screen;
|
return screen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,12 +88,14 @@ void QShapedPixmapWindow::setHotspot(const QPoint &hotspot)
|
|||||||
|
|
||||||
void QShapedPixmapWindow::updateGeometry()
|
void QShapedPixmapWindow::updateGeometry()
|
||||||
{
|
{
|
||||||
|
#ifndef QT_NO_CURSOR
|
||||||
QRect rect(QCursor::pos() - m_hotSpot, m_pixmap.size());
|
QRect rect(QCursor::pos() - m_hotSpot, m_pixmap.size());
|
||||||
if (m_pixmap.isNull())
|
if (m_pixmap.isNull())
|
||||||
m_backingStore->resize(QSize(1,1));
|
m_backingStore->resize(QSize(1,1));
|
||||||
else if (m_backingStore->size() != m_pixmap.size())
|
else if (m_backingStore->size() != m_pixmap.size())
|
||||||
m_backingStore->resize(m_pixmap.size());
|
m_backingStore->resize(m_pixmap.size());
|
||||||
setGeometry(rect);
|
setGeometry(rect);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void QShapedPixmapWindow::exposeEvent(QExposeEvent *)
|
void QShapedPixmapWindow::exposeEvent(QExposeEvent *)
|
||||||
|
Loading…
Reference in New Issue
Block a user