209 QStylePainter
p(
this);
211 option.rect = QRect(rect().right() - 15, rect().bottom() - 15, 14, 14);
212 option.palette = palette();
213 option.palette.setBrush(QPalette::ButtonText, Qt::black);
214 option.state = QStyle::State_Enabled;
215 p.setBrush(Qt::black);
217 p.drawPrimitive(QStyle::PE_IndicatorArrowDown, option);
222 const QSize popupSize =
m_d->
frame->sizeHint();
223 QRect popupRect(QPoint(), popupSize);
234#ifdef HAVE_QT_PRIVATE_TOOLTIP_POSITION_API
235 if (
auto waylandWindow =
dynamic_cast<QNativeInterface::Private::QWaylandWindow *
>(
m_d->
frame->windowHandle()->handle())) {
239 if (this->isVisible()) {
240 QWidget *parentWidget =
m_d->
frame->parentWidget();
242 const QRect gravityRect(parentWidget->window()->mapFromGlobal(mapToGlobal(QPoint())), size());
244 waylandWindow->setParentControlGeometry(gravityRect);
245 waylandWindow->setExtendedWindowType(QNativeInterface::Private::QWaylandWindow::ComboBox);
247 QWidget *parentWidget =
m_d->
frame->parentWidget();
248 const QPoint parentPos = parentWidget->window()->mapFromGlobal(QCursor::pos());
249 const QRect gravityRect(parentPos.x() - popupSize.width() / 2, parentPos.y() - popupSize.height() / 2, popupSize.width(), popupSize.height());
251 waylandWindow->setParentControlGeometry(gravityRect);
252 waylandWindow->setExtendedWindowType(QNativeInterface::Private::QWaylandWindow::Default);
262 QScreen *screen = this->parentWidget() ? this->screen() : qApp->screenAt(QCursor::pos());
263 const QRect screenRect = screen ? screen->availableGeometry() : QRect();
268 popupRect.moveTo(
m_d->
frame->geometry().topLeft());
270 popupRect.moveTo(this->window()->geometry().center() - QRect(QPoint(0, 0), popupSize).center());
275 if (this->isVisible()) {
276 popupRect.moveTo(this->mapToGlobal(rect().bottomLeft()));
278 popupRect.moveCenter(QCursor::pos());
282 if (!screenRect.isEmpty()) {