Fix initializing alignment; this shouldn't use nullptr
This commit is contained in:
parent
ee7539cf6e
commit
8ee82c9a3c
|
@ -136,9 +136,9 @@ void cornerWidget(QWidget *widget, const QPoint *position)
|
||||||
{
|
{
|
||||||
const QPoint cursorPos(position ? *position : QCursor::pos());
|
const QPoint cursorPos(position ? *position : QCursor::pos());
|
||||||
const QRect availableGeometry(availableScreenGeometryAtPoint(cursorPos));
|
const QRect availableGeometry(availableScreenGeometryAtPoint(cursorPos));
|
||||||
Qt::Alignment alignment = nullptr;
|
const Qt::Alignment alignment
|
||||||
alignment |= (cursorPos.x() - availableGeometry.left() < availableGeometry.right() - cursorPos.x() ? Qt::AlignLeft : Qt::AlignRight);
|
= (cursorPos.x() - availableGeometry.left() < availableGeometry.right() - cursorPos.x() ? Qt::AlignLeft : Qt::AlignRight)
|
||||||
alignment |= (cursorPos.y() - availableGeometry.top() < availableGeometry.bottom() - cursorPos.y() ? Qt::AlignTop : Qt::AlignBottom);
|
| (cursorPos.y() - availableGeometry.top() < availableGeometry.bottom() - cursorPos.y() ? Qt::AlignTop : Qt::AlignBottom);
|
||||||
widget->setGeometry(QStyle::alignedRect(Qt::LeftToRight, alignment, widget->size(), availableGeometry));
|
widget->setGeometry(QStyle::alignedRect(Qt::LeftToRight, alignment, widget->size(), availableGeometry));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue