40 #include <QtWidgets/private/qtwidgetsglobal_p.h>
49 #if QT_CONFIG(effects)
50 #include <private/qeffects_p.h>
54 #include <qpa/qplatformscreen.h>
55 #include <qpa/qplatformcursor.h>
56 #include <private/qstylesheetstyle_p.h>
59 #include <QtWidgets/private/qlabel_p.h>
60 #include <QtGui/private/qhighdpiscaling_p.h>
147 #ifndef QT_NO_STYLE_STYLESHEET
154 styleSheetParent =
nullptr;
170 #ifndef QT_NO_STYLE_STYLESHEET
185 qApp->installEventFilter(
this);
195 if (msecDisplayTime > 0)
196 time = msecDisplayTime;
203 #ifndef QT_NO_STYLE_STYLESHEET
204 if (styleSheetParent){
207 styleSheetParent =
nullptr;
218 d_func()->setScreenForPoint(
pos);
289 qWarning(
"QToolTip::setTipRect: Cannot pass null widget if rect is set");
324 #if defined (Q_OS_QNX) || defined (Q_OS_WASM)
365 return exact ? exact : guess;
370 #ifndef QT_NO_STYLE_STYLESHEET
406 if (
p.x() +
this->width() > screenRect.
x() + screenRect.
width())
407 p.rx() -= 4 + this->
width();
408 if (p.
y() +
this->height() > screenRect.
y() + screenRect.
height())
410 if (p.
y() < screenRect.
y())
411 p.setY(screenRect.
y());
412 if (
p.x() +
this->width() > screenRect.
x() + screenRect.
width())
413 p.setX(screenRect.
x() + screenRect.
width() -
this->width());
414 if (
p.x() < screenRect.
x())
415 p.setX(screenRect.
x());
416 if (
p.y() +
this->height() > screenRect.
y() + screenRect.
height())
417 p.setY(screenRect.
y() + screenRect.
height() -
this->height());
470 localPos =
w->mapFromGlobal(
pos);
497 #if QT_CONFIG(effects)
557 return *tooltip_palette();
597 #include "qtooltip.moc"
static bool isEffectEnabled(Qt::UIEffect)
static void setFont(const QFont &, const char *className=nullptr)
The QBasicTimer class provides timer events for objects.
void start(int msec, QObject *obj)
int timerId() const noexcept
bool isActive() const noexcept
The QEvent class is the base class of all event classes. Event objects contain event parameters.
The QFont class specifies a query for a font used for drawing text.
The QFontMetrics class provides font metrics information.
QScreen * primaryScreen
the primary (or default) screen of the application.
The QKeyEvent class describes a key event.
The QLabel widget provides a text or image display.
void setText(const QString &)
void paintEvent(QPaintEvent *) override
void setAlignment(Qt::Alignment)
void setWordWrap(bool on)
bool wordWrap
the label's word-wrapping policy
QString text
the label's text
void mouseMoveEvent(QMouseEvent *ev) override
QSize sizeHint() const override
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal.
The QMouseEvent class contains parameters that describe a mouse event.
The QObject class is the base class of all Qt objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
void setObjectName(const QString &name)
bool setProperty(const char *name, const QVariant &value)
void destroyed(QObject *=nullptr)
The QPaintEvent class contains event parameters for paint events. \inmodule QtGui.
The QPalette class contains color groups for each widget state.
constexpr QPoint toPoint() const
The QPoint class defines a point in the plane using integer precision.
constexpr int y() const noexcept
The QRect class defines a rectangle in the plane using integer precision.
constexpr int height() const noexcept
constexpr bool isNull() const noexcept
bool contains(const QRect &r, bool proper=false) const noexcept
constexpr int x() const noexcept
constexpr int width() const noexcept
constexpr int y() const noexcept
The QResizeEvent class contains event parameters for resize events. \inmodule QtGui.
The QScreen class is used to query screen properties. \inmodule QtGui.
QRect geometry
the screen's geometry in pixels
QScreen * virtualSiblingAt(QPoint point)
QPlatformScreen * handle() const
The QSize class defines the size of a two-dimensional object using integer point precision.
constexpr int height() const noexcept
constexpr int width() const noexcept
constexpr int & rheight() noexcept
The QString class provides a Unicode character string.
The QStyleHintReturnMask class provides style hints that return a QRegion.
@ SH_ToolTipLabel_Opacity
@ PM_ToolTipLabelFrameWidth
the background color on which the focus rectangle is being drawn
The QStyleOption class stores the parameters used by QStyle functions.
void initFrom(const QWidget *w)
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget.
The QTimerEvent class contains parameters that describe a timer event.
void reuseTip(const QString &text, int msecDisplayTime, const QPoint &pos)
void restartExpireTimer(int msecDisplayTime)
void resizeEvent(QResizeEvent *e) override
void mouseMoveEvent(QMouseEvent *e) override
void styleSheetParentDestroyed()
void hideTipImmediately()
bool tipChanged(const QPoint &pos, const QString &text, QObject *o)
void setTipRect(QWidget *w, const QRect &r)
void paintEvent(QPaintEvent *e) override
void timerEvent(QTimerEvent *e) override
void placeTip(const QPoint &pos, QWidget *w)
QTipLabel(const QString &text, const QPoint &pos, QWidget *w, int msecDisplayTime)
static QScreen * getTipScreen(const QPoint &pos, QWidget *w)
static QTipLabel * instance
bool eventFilter(QObject *, QEvent *) override
void adjustTooltipScreen(const QPoint &pos)
void updateSize(const QPoint &pos)
The QVariant class acts like a union for the most common Qt data types.
static auto fromValue(const T &value) -> std::enable_if_t< std::is_copy_constructible_v< T >, QVariant >
The QWindow class represents a window in the underlying windowing system.
T fromNativePixels(const T &value, const C *context)
Q_GUI_EXPORT bool mightBeRichText(const QString &)
@ BypassGraphicsProxyWidget
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld SRC pixld MASK if DST_R else pixld DST_R endif if
void qScrollEffect(QWidget *w, QEffects::DirFlags orient, int time)
void qFadeEffect(QWidget *w, int time)
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
GLenum GLuint GLenum GLsizei length
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr offset
QStyleSheetStyle * qt_styleSheet(QStyle *style)