78 {
79 resize(100, 150);
80
81
82
83
85
86#ifdef HAVE_QT_PRIVATE_TOOLTIP_POSITION_API
87 if (auto waylandWindow = dynamic_cast<QNativeInterface::Private::QWaylandWindow *>(windowHandle()->handle())) {
88 QWidget *referenceWidget = findNearestDockerOrNativeParent(parentWidget());
89 if (!referenceWidget) {
90 referenceWidget = parentWidget();
91 }
92
93 const QPoint parentPos = parentWidget()->window()->mapFromGlobal(referenceWidget->mapToGlobal(QPoint()));
94 const QRect gravityRect(QRect(parentPos, QSize(referenceWidget->width(), 10)));
95
96 waylandWindow->setParentControlGeometry(gravityRect);
97
98
99
100 waylandWindow->setExtendedWindowType(QNativeInterface::Private::QWaylandWindow::SubMenu);
101 } else
102#endif
103 {
104 QPoint parentPos =
m_parent->mapToGlobal(QPoint(0,0));
105 const QRect availRect = this->screen()->availableGeometry();
106 QPoint targetPos;
107 if ( parentPos.x() - 100 > availRect.x() ) {
108 targetPos = QPoint(parentPos.x() - 100, parentPos.y());
109 }
else if ( parentPos.x() +
m_parent->width() + 100 < availRect.right()) {
111 } else if ( parentPos.y() - 100 > availRect.y() ) {
112 targetPos = QPoint(parentPos.x(), parentPos.y() - 100);
113 } else {
114 targetPos = QPoint(parentPos.x(), parentPos.y() +
m_parent->height());
115 }
116 move(targetPos.x(), targetPos.y());
117 }
118 }
QPainterPath create(const char32_t codepoint, double height)
Creates a tofu missing glyph indicator representing the provided Unicode codepoint.